diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-12-02 15:00:05 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2009-12-02 15:00:05 +0000 |
commit | 60d47abfcfa901aafd85ba49b12d5994d7ef9aae (patch) | |
tree | 107d03a1528fc7c327a0410cdf75b3cfaeedc7c8 /testsuites | |
parent | 2009-12-02 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-60d47abfcfa901aafd85ba49b12d5994d7ef9aae.tar.bz2 |
New.
Diffstat (limited to 'testsuites')
36 files changed, 752 insertions, 0 deletions
diff --git a/testsuites/libtests/POSIX/.cvsignore b/testsuites/libtests/POSIX/.cvsignore new file mode 100644 index 0000000000..70845e08eb --- /dev/null +++ b/testsuites/libtests/POSIX/.cvsignore @@ -0,0 +1 @@ +Makefile.in diff --git a/testsuites/libtests/POSIX/COPYING b/testsuites/libtests/POSIX/COPYING new file mode 100644 index 0000000000..60e7ccebb7 --- /dev/null +++ b/testsuites/libtests/POSIX/COPYING @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + diff --git a/testsuites/libtests/POSIX/Makefile.am b/testsuites/libtests/POSIX/Makefile.am new file mode 100644 index 0000000000..2cef1020a1 --- /dev/null +++ b/testsuites/libtests/POSIX/Makefile.am @@ -0,0 +1,101 @@ +CC = @CC@ $(GCCSPECS) + +check_PROGRAMS = + +check_PROGRAMS += calloc +calloc_SOURCES = calloc.c + +check_PROGRAMS += close +close_SOURCES = close.c + +check_PROGRAMS += dup2 +dup2_SOURCES = dup2.c + +check_PROGRAMS += fcntl +fcntl_SOURCES = fcntl.c + +check_PROGRAMS += fork +fork_SOURCES = fork.c + +check_PROGRAMS += free +free_SOURCES = free.c + +check_PROGRAMS += fstat +fstat_SOURCES = fstat.c + +# FIXME: BSD-proprietary +# check_PROGRAMS += getdents +# getdents_SOURCES = getdents.c + +check_PROGRAMS += getlogin +getlogin_SOURCES = getlogin.c + +check_PROGRAMS += getpwnam +getpwnam_SOURCES = getpwnam.c + +check_PROGRAMS += getpwuid +getpwuid_SOURCES = getpwuid.c + +check_PROGRAMS += getuid +getuid_SOURCES = getuid.c + +# FIXME: BSD-proprietary +# check_PROGRAMS += issetugid +# issetugid_SOURCES = issetugid.c + +check_PROGRAMS += lseek +lseek_SOURCES = lseek.c + +check_PROGRAMS += longjmp +longjmp_SOURCES = longjmp.c + +check_PROGRAMS += lstat +lstat_SOURCES = lstat.c + +check_PROGRAMS += kill +kill_SOURCES = kill.c + +check_PROGRAMS += malloc +malloc_SOURCES = malloc.c + +check_PROGRAMS += nanosleep +nanosleep_SOURCES = nanosleep.c + +check_PROGRAMS += open +open_SOURCES = open.c + +check_PROGRAMS += pipe +pipe_SOURCES = pipe.c + +check_PROGRAMS += posix_memalign +posix_memalign_SOURCES = posix_memalign.c + +check_PROGRAMS += read +read_SOURCES = read.c + +check_PROGRAMS += realloc +realloc_SOURCES = realloc.c + +check_PROGRAMS += setjmp +setjmp_SOURCES = setjmp.c + +check_PROGRAMS += sigfillset +sigfillset_SOURCES = sigfillset.c + +check_PROGRAMS += sigprocmask +sigprocmask_SOURCES = sigprocmask.c + +check_PROGRAMS += stat +stat_SOURCES = stat.c + +check_PROGRAMS += unlink +unlink_SOURCES = unlink.c + +check_PROGRAMS += vfork +vfork_SOURCES = vfork.c + +check_PROGRAMS += waitpid +waitpid_SOURCES = waitpid.c + +check_PROGRAMS += write +write_SOURCES = write.c diff --git a/testsuites/libtests/POSIX/README b/testsuites/libtests/POSIX/README new file mode 100644 index 0000000000..48dfa8121f --- /dev/null +++ b/testsuites/libtests/POSIX/README @@ -0,0 +1,25 @@ +This testsuite consists of a collection of (non-functional) programs snippets +to check an RTEMS toolchain consisting of +* GCC (libgcc etc.) +* binutils +* newlib (libc) +* RTEMS (librtemscpu + librtemsbsp) +for IEEE Std 1003.1-2008 (aka. POSIX[1]) compliance by link-tests. + +All of these programs are supposed to be compilable without any warning, +independently of the configuration being used in any of the components +involved. + +NB: +- Using "advanced GCC warning flags" may trigger warnings. Such warnings + should be avoided if possible. + +- These program snippets are not supposed to be functional. + +- This suite only checks for a subset of POSIX library calls, which are + known to have been critical in RTEMS/GCC/newlib interaction at some point + in RTEMS/GCC/newlib's history. + +References: +[1] The Open Group Base Specifications Issue 7, IEEE Std 1003.1™-2008, + http://www.opengroup.org/onlinepubs/9699919799 diff --git a/testsuites/libtests/POSIX/calloc.c b/testsuites/libtests/POSIX/calloc.c new file mode 100644 index 0000000000..e46ae1a2f3 --- /dev/null +++ b/testsuites/libtests/POSIX/calloc.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdlib.h> + +int +main (void) +{ + void *foo = calloc (42, 43); + + return (foo != NULL); +} diff --git a/testsuites/libtests/POSIX/close.c b/testsuites/libtests/POSIX/close.c new file mode 100644 index 0000000000..832320d4e3 --- /dev/null +++ b/testsuites/libtests/POSIX/close.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + close (42); + + return 0; +} diff --git a/testsuites/libtests/POSIX/dup2.c b/testsuites/libtests/POSIX/dup2.c new file mode 100644 index 0000000000..c9d231217c --- /dev/null +++ b/testsuites/libtests/POSIX/dup2.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + int oldfd = 42; + int newfd = 43; + + dup2 (oldfd, newfd); + + return 0; +} diff --git a/testsuites/libtests/POSIX/fcntl.c b/testsuites/libtests/POSIX/fcntl.c new file mode 100644 index 0000000000..3e4844e957 --- /dev/null +++ b/testsuites/libtests/POSIX/fcntl.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> +#include <fcntl.h> + +int +main (void) +{ + fcntl (42, 43); + fcntl (42, 43, 44); + + return 0; +} diff --git a/testsuites/libtests/POSIX/fork.c b/testsuites/libtests/POSIX/fork.c new file mode 100644 index 0000000000..1fc5d5d977 --- /dev/null +++ b/testsuites/libtests/POSIX/fork.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + fork (); + + return 0; +} diff --git a/testsuites/libtests/POSIX/free.c b/testsuites/libtests/POSIX/free.c new file mode 100644 index 0000000000..e139949cf0 --- /dev/null +++ b/testsuites/libtests/POSIX/free.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdlib.h> + +int +main (void) +{ + free ((void *) 42); + + return 0; +} diff --git a/testsuites/libtests/POSIX/fstat.c b/testsuites/libtests/POSIX/fstat.c new file mode 100644 index 0000000000..f734917bf7 --- /dev/null +++ b/testsuites/libtests/POSIX/fstat.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +int +main (void) +{ + struct stat buf; + int fd = 42; + fstat (fd, &buf); + + return 0; +} diff --git a/testsuites/libtests/POSIX/getdents.c b/testsuites/libtests/POSIX/getdents.c new file mode 100644 index 0000000000..74b4f119fb --- /dev/null +++ b/testsuites/libtests/POSIX/getdents.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <dirent.h> + +int +main (void) +{ + int status; + int fd = 42; + + status = getdents (fd, "/tmp/foo", 0); +} diff --git a/testsuites/libtests/POSIX/getlogin.c b/testsuites/libtests/POSIX/getlogin.c new file mode 100644 index 0000000000..9cfd9f9e66 --- /dev/null +++ b/testsuites/libtests/POSIX/getlogin.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + char *login; + login = getlogin (); + + return 0; +} diff --git a/testsuites/libtests/POSIX/getpwnam.c b/testsuites/libtests/POSIX/getpwnam.c new file mode 100644 index 0000000000..89f307e4b9 --- /dev/null +++ b/testsuites/libtests/POSIX/getpwnam.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <pwd.h> + +int +main (void) +{ + struct passwd *pass; + pass = getpwnam ("root"); + + return 0; +} diff --git a/testsuites/libtests/POSIX/getpwuid.c b/testsuites/libtests/POSIX/getpwuid.c new file mode 100644 index 0000000000..42e36a22d8 --- /dev/null +++ b/testsuites/libtests/POSIX/getpwuid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <pwd.h> + +int +main (void) +{ + struct passwd *pass; + pass = getpwnam (0); + + return (pass != NULL); +} diff --git a/testsuites/libtests/POSIX/getuid.c b/testsuites/libtests/POSIX/getuid.c new file mode 100644 index 0000000000..48c7ad135d --- /dev/null +++ b/testsuites/libtests/POSIX/getuid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> +#include <sys/types.h> + +int +main (void) +{ + uid_t uid; + uid = getuid (); + + return 0; +} diff --git a/testsuites/libtests/POSIX/issetugid.c b/testsuites/libtests/POSIX/issetugid.c new file mode 100644 index 0000000000..f414cf2f6f --- /dev/null +++ b/testsuites/libtests/POSIX/issetugid.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + int status; + status = issetugid (); + + return 0; +} diff --git a/testsuites/libtests/POSIX/kill.c b/testsuites/libtests/POSIX/kill.c new file mode 100644 index 0000000000..ab6f38c823 --- /dev/null +++ b/testsuites/libtests/POSIX/kill.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <signal.h> + +int +main (void) +{ + pid_t pid = 0; + + kill (pid, SIGHUP); + kill (pid, SIGKILL); + kill (pid, SIGTERM); + + return 0; +} diff --git a/testsuites/libtests/POSIX/longjmp.c b/testsuites/libtests/POSIX/longjmp.c new file mode 100644 index 0000000000..1eb8291ab1 --- /dev/null +++ b/testsuites/libtests/POSIX/longjmp.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <setjmp.h> + +int +main (void) +{ + jmp_buf buf; + longjmp (buf, 0); + return 0; +} diff --git a/testsuites/libtests/POSIX/lseek.c b/testsuites/libtests/POSIX/lseek.c new file mode 100644 index 0000000000..f9309fdf59 --- /dev/null +++ b/testsuites/libtests/POSIX/lseek.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <unistd.h> + +int +main (void) +{ + off_t res; + int fd = 42; + + res = lseek (fd, 0, SEEK_SET); + res = lseek (fd, 1, SEEK_CUR); + res = lseek (fd, 2, SEEK_END); + + return 0; +} diff --git a/testsuites/libtests/POSIX/lstat.c b/testsuites/libtests/POSIX/lstat.c new file mode 100644 index 0000000000..0139064eca --- /dev/null +++ b/testsuites/libtests/POSIX/lstat.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +int +main (void) +{ + struct stat buf; + int status; + + status = lstat ("/tmp/foo", &buf); + + return 0; +} diff --git a/testsuites/libtests/POSIX/malloc.c b/testsuites/libtests/POSIX/malloc.c new file mode 100644 index 0000000000..0e936b36da --- /dev/null +++ b/testsuites/libtests/POSIX/malloc.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdlib.h> + +int +main (void) +{ + void *ptr = malloc (42); + + return (ptr != NULL); +} diff --git a/testsuites/libtests/POSIX/nanosleep.c b/testsuites/libtests/POSIX/nanosleep.c new file mode 100644 index 0000000000..af0ff8f786 --- /dev/null +++ b/testsuites/libtests/POSIX/nanosleep.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <time.h> + +int +main (void) +{ + struct timespec req = { 0, 42 }; + struct timespec rem; + int status; + + status = nanosleep (&req, &rem); + + return 0; +} diff --git a/testsuites/libtests/POSIX/open.c b/testsuites/libtests/POSIX/open.c new file mode 100644 index 0000000000..b3848ab113 --- /dev/null +++ b/testsuites/libtests/POSIX/open.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +int +main (void) +{ + int fd1; + int fd2; + + fd1 = open ("/tmp/foo1", O_RDWR | O_APPEND); + fd2 = open ("/tmp/foo2", O_CREAT, S_IWUSR); + + return 0; +} diff --git a/testsuites/libtests/POSIX/pipe.c b/testsuites/libtests/POSIX/pipe.c new file mode 100644 index 0000000000..debd3a0387 --- /dev/null +++ b/testsuites/libtests/POSIX/pipe.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + int filedes[2]; + int status; + + status = pipe (filedes); + + return 0; +} diff --git a/testsuites/libtests/POSIX/posix_memalign.c b/testsuites/libtests/POSIX/posix_memalign.c new file mode 100644 index 0000000000..f49dcb3413 --- /dev/null +++ b/testsuites/libtests/POSIX/posix_memalign.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdlib.h> + +int +main (void) +{ + void *a; + int ret = posix_memalign (&a, sizeof (void *) * 2, 42); + + return ret; +} diff --git a/testsuites/libtests/POSIX/read.c b/testsuites/libtests/POSIX/read.c new file mode 100644 index 0000000000..5b0a657511 --- /dev/null +++ b/testsuites/libtests/POSIX/read.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + int fd = 42; + char buf[4]; + ssize_t len; + + len = read (fd, &buf, 4); + + return 0; +} diff --git a/testsuites/libtests/POSIX/realloc.c b/testsuites/libtests/POSIX/realloc.c new file mode 100644 index 0000000000..e3e117ee52 --- /dev/null +++ b/testsuites/libtests/POSIX/realloc.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <stdlib.h> + +int +main (void) +{ + realloc (NULL, 42); + + return 0; +} diff --git a/testsuites/libtests/POSIX/setjmp.c b/testsuites/libtests/POSIX/setjmp.c new file mode 100644 index 0000000000..07ccec8b03 --- /dev/null +++ b/testsuites/libtests/POSIX/setjmp.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <setjmp.h> + +int +main (void) +{ + jmp_buf buf; + setjmp (buf); + return 0; +} diff --git a/testsuites/libtests/POSIX/sigfillset.c b/testsuites/libtests/POSIX/sigfillset.c new file mode 100644 index 0000000000..da032ecdcb --- /dev/null +++ b/testsuites/libtests/POSIX/sigfillset.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <signal.h> + +int +main (void) +{ + sigset_t set; + int status; + status = sigfillset (&set); + + return 0; +} diff --git a/testsuites/libtests/POSIX/sigprocmask.c b/testsuites/libtests/POSIX/sigprocmask.c new file mode 100644 index 0000000000..96b437b358 --- /dev/null +++ b/testsuites/libtests/POSIX/sigprocmask.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <signal.h> + +int +main (void) +{ + int status; + sigset_t set1, set2; + + status = sigprocmask (SIG_BLOCK, &set1, &set2); + status = sigprocmask (SIG_UNBLOCK, &set1, &set2); + status = sigprocmask (SIG_SETMASK, &set1, &set2); + + return 0; +} diff --git a/testsuites/libtests/POSIX/stat.c b/testsuites/libtests/POSIX/stat.c new file mode 100644 index 0000000000..352da2a4a2 --- /dev/null +++ b/testsuites/libtests/POSIX/stat.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +int +main (void) +{ + struct stat buf; + int status; + + status = stat ("/tmp/foo", &buf); + + return 0; +} diff --git a/testsuites/libtests/POSIX/unlink.c b/testsuites/libtests/POSIX/unlink.c new file mode 100644 index 0000000000..36c4ddf1ad --- /dev/null +++ b/testsuites/libtests/POSIX/unlink.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + int status; + status = unlink ("/tmp/foo"); + + return 0; +} diff --git a/testsuites/libtests/POSIX/vfork.c b/testsuites/libtests/POSIX/vfork.c new file mode 100644 index 0000000000..a947cce144 --- /dev/null +++ b/testsuites/libtests/POSIX/vfork.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <unistd.h> + +int +main (void) +{ + pid_t pid; + pid = vfork (); + + return 0; +} diff --git a/testsuites/libtests/POSIX/waitpid.c b/testsuites/libtests/POSIX/waitpid.c new file mode 100644 index 0000000000..35d55aaa2e --- /dev/null +++ b/testsuites/libtests/POSIX/waitpid.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> +#include <sys/wait.h> + +int +main (void) +{ + int status; + pid_t pid; + pid = waitpid (-1, &status, WNOHANG); + + return 0; +} diff --git a/testsuites/libtests/POSIX/write.c b/testsuites/libtests/POSIX/write.c new file mode 100644 index 0000000000..8ee6f849bb --- /dev/null +++ b/testsuites/libtests/POSIX/write.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2009 by + * Ralf Corsépius, Ulm, Germany. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <unistd.h> + +int +main (void) +{ + char string[] = "1234"; + size_t count = 4; + ssize_t ret; + + ret = write (0, &string, count); + + return 0; +} |