Posted to bradipo by Bradipo at Wed Mar 10 01:11:03 GMT 2021view pretty

$ cat haspledge.h
cat: haspledge.h: No such file or directory
$ make
( ( cc -c trypledge.c && cc -s -o trypledge trypledge.o ) >/dev/null  2>&1  && echo \#define HASPLEDGE 1 || exit 0 ) > haspledge.h
rm -f trypledge.o trypledge
$ cat haspledge.h
#define HASPLEDGE 1

$ cat Makefile 
haspledge.h: trypledge.c
        ( ( cc -c trypledge.c && cc -s -o trypledge trypledge.o ) >/dev/null \
        2>&1 \
        && echo \#define HASPLEDGE 1 || exit 0 ) > haspledge.h
        rm -f trypledge.o trypledge

$ cat trypledge.c 
#include <unistd.h>

int main()
{
  pledge("stdio",0);
}