p.enes.lv is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.

This server runs the snac software and there is no automatic sign-up process.

Site description
when penes love repeats
Admin account
@eris@p.enes.lv

Search results for tag #include

[?]twinspin :neofox_cofe: »
@twinspin6@outerheaven.club

#include <KIconTheme>

    1 ★ 0 ↺

    [?]GNÚorenard Sauvage (eris-ng) :neorenard: »
    @eris@p.enes.lv

    Ok, I'm wrong (but so are you), multicharacter character literals are cursed anyways. https://onlinegdb.com/sfxg6T53t

     <stdio.h>

    int main()
    {
    __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    puts("Little endian");
    __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
    puts("Big endian");

    printf("ayo wtf %d\n", __BYTE_ORDER__);

    printf("%", 'twinspin6');
    return 0;
    }

    main.c: In function ‘main’:
    main.c:12:19: warning: character constant too long for its type
    12 | printf("%", 'twinspin6');
    | ^~~~~~~~~~~
    Little endian
    0b1110000011010010110111000110110

      [?]GNU/翠星石 »
      @Suiseiseki@freesoftwareextremist.com

      @mia @snacks I was shared this suid binary - it looks bug-free to me?

      /* GnuPowerUtils ACPI S3 program
      Copyright © 2025 DiffieHellman

      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU Affero General Public License as
      published by the Free Software Foundation, either version 3 of the
      License, or (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      GNU Affero General Public License for more details.

      You should have received a copy of the GNU Affero General Public License
      along with this program. If not, see <https://www.gnu.org/licenses/>. */

      #include <stdio.h>
      #include <stdlib.h>
      #include <fcntl.h>
      #include <sys/types.h>
      #include <unistd.h>

      #include "shared.h"

      int main(int argc, char *argv[])
      {
      /* print help or version of there are any arguments */
      if (argc >= 2){help_or_version(argv[0], argv[1]);}

      /* exit(1) if group does not exist or member is not in group */
      check_group_membership();

      /* change to root user */
      if (setuid(0) != 0){error_exit("Suspend binary is not setuid.");}

      /* open mem_sleep and state */
      int mem_sleep = open("/sys/power/mem_sleep", O_WRONLY);
      int state = open("/sys/power/state", O_WRONLY);
      if (!mem_sleep || !state){perror_exit("Linux doesn't support Suspend-to-RAM");}

      /* write deep to /sys/power/mem_sleep then mem to /sys/power/state to Suspend-to-RAM */
      if (write(mem_sleep, "deep\n", 5) != 5){perror_exit("Writing deep failed");}
      if (write(state, "mem\n", 4) != 4){perror_exit("Writing mem failed");}

      /* close the fd's */
      close(mem_sleep);
      close(state);

      return 0;
      }

      shared.h:
      /* GnuPowerUtils shared functions
      Copyright © 2025 DiffieHellman

      This program is free software: you can redistribute it and/or modify
      it under the terms of the GNU Affero General Public License as
      published by the Free Software Foundation, either version 3 of the
      License, or (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      GNU Affero General Public License for more details.

      You should have received a copy of the GNU Affero General Public License
      along with this program. If not, see <https://www.gnu.org/licenses/>. */

      #include <grp.h>

      /* definitions and functions that would otherwise be needlessly duplicated between files */
      #ifndef GROUP_NAME
      #define GROUP_NAME "gnupu"
      #endif

      #define VERSION "0"

      void error_exit(char s[])
      {
      fprintf(stderr,"%s\n",s);
      exit(1);
      }

      void perror_exit(char s[])
      {
      perror(s);
      exit(1);
      }

      void check_group_membership()
      {
      /* get gid of power group and see if user is a member of that gid */
      struct group *gnupu = getgrnam(GROUP_NAME);
      if (!gnupu){error_exit(GROUP_NAME" group does not exist.\n");}
      if (!group_member(gnupu->gr_gid)){error_exit("User is not in "GROUP_NAME" group.\n");}
      }

      void help_or_version(char z[], char s[])
      {
      /* no point bothering to use getopt or memcmp */
      if (s[0] == '-' && ((s[1] == '-' && s[2] == 'v') || s[1] == 'v'))
      {
      printf("gnupu (GNU power utils) "VERSION"\n"\
      "Copyright © 2025 DiffieHellman\n"\
      "License AGPLv3+: GNU AGPL version 3 or later <https://www.gnu.org/licenses/agpl-3.0.html>.\n"\
      "This is free software: you are free to change and redistribute it.\n"\
      "There is NO WARRANTY, to the extent permitted by law.\n\n"\
      "Written by DiffieHellman.\n");
      }
      else
      {
      printf("Usage: %s [OPTION]\n"\
      "Do power operation on the system\n\n"\
      "With no argument, do the operation, otherwise show help or version\n\n"\
      "-h, --help show help and exit\n"\
      "-v, --version output version information and exit\n\n"\
      "Usage:\n"\
      "%s Ensure user is in the "GROUP_NAME" group and execute without arguments.\n\n"\
      "Documentation: `info gnupu`\n", z, z);
      }

      exit(0);
      }

        0 ★ 0 ↺

        [?]GNÚorenard Sauvage (eris-ng) :neorenard: »
        @eris@p.enes.lv

        That sounds like C not C++. <stdbool.h> or add a -std=gnu23 (or -std=gnu2x depending on how old your compiler is).

          [?]auroroboros »
          @auroroboros@app.wafrn.net

          include

          include

          struct lolcoin{char* hash;int quantity;};
          int savebalance(char* fname,struct lolcoin*
          lc){FILE* balance=fopen(fname,"rw");fputs(lc->quantity,balance)
          fputs("\n",balance);
          /lc

          / fputs(lc->hash,balance);return 1;}
          struct lolcoin loadbalance(char* fname){
          FILE* balance=fopen(fname,"rw");struct lolcoin lc;char temp[21];fgets(temp,20,balance);
          /this line is not a comment/lc.quantity=atoi(temp);fgets(lc.hash,20,balance);return lc;}
          int mine(struct lolcoin* lc){lc->quantity+=1;return 1;}
          int main(int argc,char** argv){printf(
          "usage: lolcoin mine filename\n");if(argc!=2){return 0;}struct lolcoin lc=loadbalance( argv[1]);mine(&lc);savebalance(argv[1],&lc);return 0;}


          #include

            [?]Freya (it/its)𒀭𒈹𒍠𒊩 »
            @freya@chaosfem.tw

            We wrote our first shared library today! libflock, implements fllock() and friends on Solaris by using fcntl, <flock.h> and add -lflock to LDFLAGS. Fixes @grunfink's snac2 and other tools not building due to incorrect locking. Will be up on our git later today. GPL2 licensed.

              2 ★ 0 ↺

              [?]GNÚorenard Sauvage (eris-ng) :neorenard: »
              @eris@p.enes.lv

              You can probably live without stuff like runtime type information and exceptions in a kernel. What remains is trivial stuff like global constructors, stuff like file access which you will be implementing yourself anyways, and stuff that requires dynamic allocation, like std::vector, std::string, but those have template arguments for specifying custom allocators. And if you're not ing the specific headers, you don't need to support that shit ¯\_(ツ)_/¯

              CC: @p@fsebugoutzone.org @shibao@misskey.bubbletea.dev

                [?]lizzy :bi_heart: :cuwu: »
                @lizzy@social.vlhl.dev

                @puppygirlhornypost2 @4censord #include everything into one file