GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Friday, 24-Nov-2023 22:24:15 JST翠星石翠星石
    in reply to
    • Pleroma-tan
    @kirby Dumping a file to stdout takes 5 lines;
    #include <stdio.h>
    #include <fcntl.h>
    #include <sys/stat.h>
    #include <unistd.h>
    #include <sys/sendfile.h>

    int main()
    {
    /* open file */
    int fp = open("main.c", O_RDONLY);

    /* get file stats */
    struct stat s;
    fstat(fp, &s);

    /* write file directly to stdout, with length from stat */
    sendfile(fileno(stdout), fp, NULL, s.st_size);

    close(fp);

    }
    In conversationFriday, 24-Nov-2023 22:24:15 JST from freesoftwareextremist.compermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.