diff options
author | Jari Aalto <jari.aalto@cante.net> | 1996-08-26 18:22:31 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:49 +0000 |
commit | 726f63884db0132f01745f1fb4465e6621088ccf (patch) | |
tree | 6c2f7765a890a97e0e513cb539df43283a8f7c4d /portbash/syscalls.sh | |
download | android_external_bash-726f63884db0132f01745f1fb4465e6621088ccf.tar.gz android_external_bash-726f63884db0132f01745f1fb4465e6621088ccf.tar.bz2 android_external_bash-726f63884db0132f01745f1fb4465e6621088ccf.zip |
Imported from ../bash-1.14.7.tar.gz.
Diffstat (limited to 'portbash/syscalls.sh')
-rw-r--r-- | portbash/syscalls.sh | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/portbash/syscalls.sh b/portbash/syscalls.sh new file mode 100644 index 0000000..e89a742 --- /dev/null +++ b/portbash/syscalls.sh @@ -0,0 +1,80 @@ +#! /bin/sh +CC=cc +export CC + +cat > x.c << EOF +/* + * exit 0 if we have the getgroups system or library call. + */ + +main() +{ + int g[100], ng; + + ng = getgroups(100, g); + if (ng) + exit(0); + exit(1); +} +EOF +if ${CC} x.c > /dev/null 2>&1 && ./a.out ; then + echo '#define HAVE_GETGROUPS' +fi +rm -f x.c x.o a.out + +cat > x.c << EOF +extern int dup2(); +main() +{ + exit(dup2(1, 2) == -1); +} +EOF + +if ${CC} x.c > /dev/null 2>&1 && ./a.out ; then + echo '#define HAVE_DUP2' +fi +rm -f a.out x.c x.o + +cat > x.c << EOF +extern int getpageesize(); +main() +{ + int n = getpagesize(); +} +EOF + +if ${CC} x.c > /dev/null 2>&1 +then + echo '#define HAVE_GETPAGESIZE' +fi +rm -f a.out x.c x.o + +cat > x.c << EOF +extern int getdtablesize(); +main() +{ + int n = getdtablesize(); +} +EOF + +if ${CC} x.c > /dev/null 2>&1 +then + echo '#define HAVE_GETDTABLESIZE' +fi +rm -f a.out x.c x.o + +cat > x.c << EOF +extern int setdtablesize(); +main() +{ + int n = setdtablesize(128); +} +EOF + +if ${CC} x.c > /dev/null 2>&1 +then + echo '#define HAVE_SETDTABLESIZE' +fi +rm -f a.out x.c x.o + +exit 0 |