├── lib ├── fs │ ├── fuse │ │ ├── stub_unionfs.h │ │ └── stub_archivemount.h │ ├── nacl-mounts │ │ └── Makefile │ └── transparent_mount.h ├── mapreduce │ ├── doc │ │ ├── buffer.png │ │ └── item_size.png │ └── Makefile ├── zrt.lo ├── networking │ ├── Makefile │ └── README ├── original_nonpth_syscalls.h └── zrtstub.h ├── libports ├── tar-1.11.8 │ ├── stamp-h │ ├── doc │ │ ├── stamp-vti │ │ ├── version.texi │ │ └── docwarn.texi │ ├── stamp-h.in │ ├── intl │ │ └── stamp-cat-id │ ├── THANKS │ ├── BACKLOG │ ├── rebox.el │ ├── ChangeLog │ ├── src │ │ ├── genfile.c │ │ ├── checktar.sh │ │ ├── fix_x64_includes.h │ │ └── ansi2knr.1 │ ├── AUTHORS │ ├── lib │ │ └── getpagesize.h │ ├── Makefile │ └── TODO ├── gtest │ ├── src │ │ └── .deps │ │ │ ├── gtest-all.Plo │ │ │ └── gtest_main.Plo │ └── Makefile ├── context-switch │ ├── tests │ │ ├── tst-makecontext-input.txt │ │ ├── tst-setcontext-input.txt │ │ ├── tst-context-input.txt │ │ └── tst-makecontext2-input.txt │ ├── test.sh │ └── Makefile ├── pth-2.0.7 │ ├── THANKS │ ├── ChangeLog │ ├── README.zerovm │ └── AUTHORS ├── lua-5.2.1 │ ├── src │ │ ├── lua.hpp │ │ ├── lapi.h │ │ └── lundump.h │ └── README └── sqlite3 │ ├── Makefile │ ├── README │ └── vfs_channel.h ├── tests ├── glibc_test_suite │ ├── mktemp │ ├── test.1234 │ ├── mounts │ │ └── glibc-fs │ │ │ └── tmp │ │ │ ├── test.dat │ │ │ ├── datemsk │ │ │ └── iconvdata │ │ │ └── testdata │ │ │ └── ISO-8859-1 │ ├── src │ │ ├── elf │ │ │ ├── tst-array5-static.c │ │ │ ├── tst-array4.c │ │ │ ├── nodlopen.c │ │ │ ├── tst-leaks1.c │ │ │ ├── testobj.h │ │ │ └── tst-tls10.h │ │ ├── login │ │ │ ├── tst-utmpx.c │ │ │ └── tst-grantpt │ │ ├── posix │ │ │ ├── 1 │ │ │ ├── bug-regex1.c │ │ │ ├── ptestcases.h │ │ │ ├── tst-cpucount.c │ │ │ ├── bug-ga1.c │ │ │ ├── bug-regex15.c │ │ │ └── spawn_int.h │ │ ├── localedata │ │ │ ├── tst-xlocale1.c │ │ │ └── tst-leaks.c │ │ ├── stdio-common │ │ │ ├── bug18a.c │ │ │ ├── tst-swscanf.c │ │ │ ├── bug19a.c │ │ │ ├── tst-unbputc.c │ │ │ ├── bug15.c │ │ │ ├── bug2.c │ │ │ ├── scanf1.c │ │ │ ├── bug21.c │ │ │ ├── bug11.c │ │ │ ├── scanf10.c │ │ │ ├── scanf8.c │ │ │ ├── tst-setvbuf1.c │ │ │ ├── tst-sscanf.c │ │ │ ├── scanf5.c │ │ │ ├── tst-wc-printf.c │ │ │ ├── bug9.c │ │ │ ├── scanf7.c │ │ │ ├── bug10.c │ │ │ ├── tst-fgets.c │ │ │ ├── scanf4.c │ │ │ ├── bug14.c │ │ │ ├── scanf9.c │ │ │ ├── bug1.c │ │ │ ├── bug13.c │ │ │ ├── scanf2.c │ │ │ ├── scanf3.c │ │ │ ├── bug8.c │ │ │ ├── bug17.c │ │ │ ├── tst-put-error.c │ │ │ └── bug20.c │ │ ├── string │ │ │ ├── noinl-tester.c │ │ │ ├── inl-tester.c │ │ │ ├── tst-strfry.c │ │ │ ├── bug-strpbrk1.c │ │ │ ├── bug-strspn1.c │ │ │ ├── tst-strtok.c │ │ │ ├── bug-strncat1.c │ │ │ └── bug-strcoll1.c │ │ ├── libio │ │ │ ├── tst-wmemstream1.c │ │ │ ├── tst-wmemstream2.c │ │ │ ├── tst_wprintf.c │ │ │ ├── tst-sscanf.c │ │ │ └── tst-setvbuf1.c │ │ ├── wcsmbs │ │ │ ├── tst-wchar-h.c │ │ │ ├── wcsatcliff.c │ │ │ └── tst-wcstof.c │ │ ├── csu │ │ │ └── tst-empty.c │ │ ├── gmon │ │ │ └── tst-profile-static.c │ │ ├── crypt │ │ │ └── md5c-test.c │ │ ├── stdlib │ │ │ ├── tst-putenv.c │ │ │ ├── tst-atof1.c │ │ │ └── testsort.c │ │ ├── dlfcn │ │ │ └── bug-dlopen1.c │ │ ├── math │ │ │ └── test-matherr.c │ │ ├── time │ │ │ ├── bug-mktime1.c │ │ │ ├── tst_wcsftime.c │ │ │ ├── bug-asctime_r.c │ │ │ └── bug-asctime.c │ │ ├── malloc │ │ │ └── tst-valloc.c │ │ ├── io │ │ │ ├── bug-ftw5.c │ │ │ └── tst-statvfs.c │ │ ├── argp │ │ │ └── bug-argp1.c │ │ ├── misc │ │ │ ├── tst-hsearch.c │ │ │ ├── tst-error1.c │ │ │ └── tst-mntent2.c │ │ ├── setjmp │ │ │ └── jmpbug.c │ │ └── dirent │ │ │ └── tst-fdopendir2.c │ ├── channel_contents.1234 │ ├── include │ │ ├── tst-pie1.c │ │ ├── tst-deep1mod1.c │ │ ├── tst-tlsmod17b.c │ │ ├── tst-tlsmod18a.c │ │ ├── tst-tlsmod17a.c │ │ └── tst-array5dep.c │ ├── xcheck │ │ ├── posix │ │ │ ├── tst-regex.c │ │ │ └── spawn_int.h │ │ ├── stdio-common │ │ │ ├── scanf12.c │ │ │ ├── bug6.c │ │ │ └── bug22.c │ │ └── libio │ │ │ └── tst_wscanf.c │ ├── localisation │ │ ├── share │ │ │ └── locale.alias │ │ └── generator.sh │ ├── api │ │ ├── stub-tag.h │ │ ├── tst-audit.h │ │ └── ztests64_compatibility.h │ ├── cleanup.sh │ ├── xexcluded │ │ ├── posix │ │ │ ├── tst-execl1.c │ │ │ ├── tst-execv1.c │ │ │ ├── tst-execle1.c │ │ │ ├── tst-execve1.c │ │ │ ├── tst-execlp1.c │ │ │ ├── tst-execvp1.c │ │ │ ├── tst-execvp3.c │ │ │ └── test-vfork.c │ │ └── elf │ │ │ ├── tst-dlmopen3.c │ │ │ ├── tst-global1.c │ │ │ └── tst-addr1.x │ ├── todo │ │ └── README │ ├── run_tests.sh │ ├── xfail │ │ └── posix │ │ │ └── spawn_int.h │ └── LICENSE ├── pjd-fstest-20080816 │ ├── redirect_pipe │ │ ├── tst.txt │ │ ├── tst2.txt │ │ ├── tst-sum.txt │ │ └── test1.sh │ ├── run_zrtfs_tests.sh │ ├── tests │ │ ├── conf │ │ ├── unlink │ │ │ ├── 13.t │ │ │ ├── 04.t │ │ │ ├── 02.t │ │ │ ├── 01.t │ │ │ ├── 07.t │ │ │ ├── 08.t │ │ │ ├── 05.t │ │ │ ├── 06.t │ │ │ ├── 12.t │ │ │ └── 03.t │ │ ├── mkfifo │ │ │ ├── 12.t │ │ │ ├── 02.t │ │ │ ├── 04.t │ │ │ ├── 01.t │ │ │ ├── 07.t │ │ │ ├── 09.t │ │ │ ├── 03.t │ │ │ ├── 11.t │ │ │ ├── 08.t │ │ │ ├── 05.t │ │ │ └── 06.t │ │ ├── truncate │ │ │ ├── 09.t │ │ │ ├── 14.t │ │ │ ├── 13.t │ │ │ ├── 04.t │ │ │ ├── 02.t │ │ │ ├── 01.t │ │ │ ├── 11.t │ │ │ ├── 07.t │ │ │ ├── 06.t │ │ │ ├── 12.t │ │ │ └── 03.t │ │ ├── chown │ │ │ ├── 10.t │ │ │ ├── 04.t │ │ │ ├── 02.t │ │ │ ├── 01.t │ │ │ ├── 06.t │ │ │ ├── 03.t │ │ │ └── 07.t │ │ ├── mkdir │ │ │ ├── 02.t │ │ │ ├── 04.t │ │ │ ├── 01.t │ │ │ ├── 12.t │ │ │ ├── 07.t │ │ │ ├── 03.t │ │ │ ├── 11.t │ │ │ ├── 09.t │ │ │ └── 10.t │ │ ├── chflags │ │ │ ├── 13.t │ │ │ ├── 04.t │ │ │ ├── 01.t │ │ │ ├── 02.t │ │ │ ├── 06.t │ │ │ └── 03.t │ │ ├── rmdir │ │ │ ├── 04.t │ │ │ ├── 02.t │ │ │ ├── 15.t │ │ │ ├── 05.t │ │ │ ├── 13.t │ │ │ ├── 12.t │ │ │ ├── 00.t │ │ │ ├── 14.t │ │ │ ├── 03.t │ │ │ ├── 07.t │ │ │ ├── 08.t │ │ │ └── 01.t │ │ ├── symlink │ │ │ ├── 04.t │ │ │ ├── 01.t │ │ │ ├── 07.t │ │ │ ├── 02.t │ │ │ ├── 12.t │ │ │ ├── 08.t │ │ │ ├── 11.t │ │ │ ├── 00.t │ │ │ ├── 06.t │ │ │ ├── 10.t │ │ │ ├── 05.t │ │ │ └── 03.t │ │ ├── chmod │ │ │ ├── 04.t │ │ │ ├── 02.t │ │ │ ├── 01.t │ │ │ ├── 10.t │ │ │ ├── 06.t │ │ │ ├── 03.t │ │ │ └── 09.t │ │ ├── link │ │ │ ├── 09.t │ │ │ ├── 04.t │ │ │ ├── 17.t │ │ │ ├── 01.t │ │ │ ├── 02.t │ │ │ ├── 08.t │ │ │ ├── 10.t │ │ │ ├── 14.t │ │ │ ├── 11.t │ │ │ └── 05.t │ │ ├── open │ │ │ ├── 17.t │ │ │ ├── 12.t │ │ │ ├── 08.t │ │ │ ├── 02.t │ │ │ ├── 20.t │ │ │ ├── 21.t │ │ │ ├── 13.t │ │ │ ├── 23.t │ │ │ ├── 01.t │ │ │ ├── 04.t │ │ │ ├── 15.t │ │ │ ├── 18.t │ │ │ ├── 19.t │ │ │ └── 16.t │ │ └── rename │ │ │ ├── 18.t │ │ │ ├── 03.t │ │ │ ├── 01.t │ │ │ ├── 17.t │ │ │ ├── 12.t │ │ │ ├── 11.t │ │ │ ├── 19.t │ │ │ ├── 14.t │ │ │ ├── 13.t │ │ │ ├── 02.t │ │ │ ├── 16.t │ │ │ └── 20.t │ ├── run_test.sh │ ├── kill_fstest.sh │ └── Makefile ├── lua_test_suite │ ├── lua-5.2.1-tests │ │ ├── db.lua │ │ ├── pm.lua │ │ ├── files.lua │ │ ├── sort.lua │ │ ├── strings.lua │ │ ├── literals.lua │ │ └── libs │ │ │ ├── lib21.c │ │ │ ├── lib11.c │ │ │ ├── lib2.c │ │ │ └── makefile │ ├── lua.nvram │ ├── run_tests.sh │ └── README ├── zrt_test_suite │ ├── tests │ │ └── possible_slow_autotests │ │ │ └── README │ ├── mounts │ │ └── fstab.conf │ └── nvram_tests.template └── daemon_client.py ├── run.env ├── kill_daemons.sh ├── .gitignore ├── locale ├── locale_patched │ ├── Makefile │ └── add_all_patched_zrt_locales.sh ├── locale_compiled │ ├── add_all_zrt_locales.sh │ └── localedef │ │ ├── mounts │ │ └── fstab.conf │ │ └── Makefile ├── README └── locales ├── contrib └── jenkins │ └── bootstrap.sh ├── cleanup.sh └── gdb_commands.template /lib/fs/fuse/stub_unionfs.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/fs/fuse/stub_archivemount.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/stamp-h: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/mktemp: -------------------------------------------------------------------------------- 1 | mount -u 2 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/doc/stamp-vti: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/stamp-h.in: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/test.1234: -------------------------------------------------------------------------------- 1 | remount 2 | -------------------------------------------------------------------------------- /libports/gtest/src/.deps/gtest-all.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /libports/gtest/src/.deps/gtest_main.Plo: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/intl/stamp-cat-id: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /run.env: -------------------------------------------------------------------------------- 1 | ZEROVM=${ZVM_PREFIX}/bin/zerovm 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/mounts/glibc-fs/tmp/test.dat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libports/context-switch/tests/tst-makecontext-input.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/redirect_pipe/tst.txt: -------------------------------------------------------------------------------- 1 | text file1 2 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/redirect_pipe/tst2.txt: -------------------------------------------------------------------------------- 1 | text file2 2 | -------------------------------------------------------------------------------- /kill_daemons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | pkill '^zvm\.' 2>/dev/null 3 | exit 0 4 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/tst-array5-static.c: -------------------------------------------------------------------------------- 1 | #include "tst-array5.c" 2 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/mounts/glibc-fs/tmp/datemsk: -------------------------------------------------------------------------------- 1 | %H:%M:%S %F 2 | %d-%m-%Y %T 3 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/redirect_pipe/tst-sum.txt: -------------------------------------------------------------------------------- 1 | text file1 2 | text file2 3 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/login/tst-utmpx.c: -------------------------------------------------------------------------------- 1 | #define UTMPX 2 | #include "tst-utmp.c" 3 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/channel_contents.1234: -------------------------------------------------------------------------------- 1 | something something something something 2 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-pie1.c: -------------------------------------------------------------------------------- 1 | int 2 | foo (void) 3 | { 4 | return 34; 5 | } 6 | -------------------------------------------------------------------------------- /libports/pth-2.0.7/THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/pth-2.0.7/THANKS -------------------------------------------------------------------------------- /libports/tar-1.11.8/THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/THANKS -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/run_zrtfs_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./run_test.sh "tests -r" 4 | -------------------------------------------------------------------------------- /lib/mapreduce/doc/buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/lib/mapreduce/doc/buffer.png -------------------------------------------------------------------------------- /libports/pth-2.0.7/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/pth-2.0.7/ChangeLog -------------------------------------------------------------------------------- /libports/tar-1.11.8/BACKLOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/BACKLOG -------------------------------------------------------------------------------- /libports/tar-1.11.8/rebox.el: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/rebox.el -------------------------------------------------------------------------------- /lib/mapreduce/doc/item_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/lib/mapreduce/doc/item_size.png -------------------------------------------------------------------------------- /libports/tar-1.11.8/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/ChangeLog -------------------------------------------------------------------------------- /libports/tar-1.11.8/doc/version.texi: -------------------------------------------------------------------------------- 1 | @set EDITION 1.11.8 2 | @set UPDATED June 1995 3 | @set VERSION 1.11.8 4 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/src/genfile.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/src/genfile.c -------------------------------------------------------------------------------- /libports/tar-1.11.8/src/checktar.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/libports/tar-1.11.8/src/checktar.sh -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/db.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/db.lua -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/pm.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/pm.lua -------------------------------------------------------------------------------- /libports/tar-1.11.8/doc/docwarn.texi: -------------------------------------------------------------------------------- 1 | @quotation 2 | @emph{(This message will disappear, once this node revised.)} 3 | @end quotation 4 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/login/tst-grantpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/src/login/tst-grantpt -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/bug-regex1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/src/posix/bug-regex1.c -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/ptestcases.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/src/posix/ptestcases.h -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/files.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/files.lua -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/sort.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/sort.lua -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/posix/tst-regex.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/xcheck/posix/tst-regex.c -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/strings.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/strings.lua -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/literals.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/lua_test_suite/lua-5.2.1-tests/literals.lua -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/localedata/tst-xlocale1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/src/localedata/tst-xlocale1.c -------------------------------------------------------------------------------- /tests/glibc_test_suite/localisation/share/locale.alias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/localisation/share/locale.alias -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug18a.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define CHAR wchar_t 3 | #define L(str) L##str 4 | #define SSCANF swscanf 5 | 6 | #include "bug18.c" 7 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/noinl-tester.c: -------------------------------------------------------------------------------- 1 | /* We don't want to test any of the inline functions here. */ 2 | 3 | #define __NO_STRING_INLINES 1 4 | #include "tester.c" 5 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-swscanf.c: -------------------------------------------------------------------------------- 1 | #define CHAR wchar_t 2 | #define L(str) L##str 3 | #define SSCANF swscanf 4 | #include 5 | #include "tst-sscanf.c" 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .cproject 3 | *.o 4 | *.nexe 5 | *.a 6 | *.manifest 7 | tests/zrt_test_suite/autotests/channels/forwriting 8 | *.Po 9 | *.Plo 10 | README.gen 11 | *.tar 12 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/mounts/glibc-fs/tmp/iconvdata/testdata/ISO-8859-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zerovm/zrt/HEAD/tests/glibc_test_suite/mounts/glibc-fs/tmp/iconvdata/testdata/ISO-8859-1 -------------------------------------------------------------------------------- /libports/tar-1.11.8/src/fix_x64_includes.h: -------------------------------------------------------------------------------- 1 | #ifndef FIX_X64_INCLUDES_H 2 | #define FIX_X64_INCLUDES_H 3 | 4 | void * __tar_xstrdup(); 5 | void * tar_xmalloc(); 6 | 7 | #endif //FIX_X64_INCLUDES_H 8 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug19a.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define CHAR wchar_t 3 | #define L(str) L##str 4 | #define FPUTS fputws 5 | #define FSCANF fwscanf 6 | 7 | #include "bug19.c" 8 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/libio/tst-wmemstream1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define CHAR_T wchar_t 4 | #define W(o) L##o 5 | #define OPEN_MEMSTREAM open_wmemstream 6 | 7 | #include "tst-memstream1.c" 8 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/libio/tst-wmemstream2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define CHAR_T wchar_t 4 | #define W(o) L##o 5 | #define OPEN_MEMSTREAM open_wmemstream 6 | 7 | #include "tst-memstream2.c" 8 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-unbputc.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int 5 | main (void) 6 | { 7 | putc ('1', stderr); 8 | putc ('2', stderr); 9 | 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/inl-tester.c: -------------------------------------------------------------------------------- 1 | /* We want to test the inline functions here. */ 2 | 3 | #define DO_STRING_INLINES 4 | #undef __USE_STRING_INLINES 5 | #define __USE_STRING_INLINES 1 6 | #include "tester.c" 7 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/wcsmbs/tst-wchar-h.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char** argv) 6 | { 7 | mbstate_t x; 8 | return sizeof (x) - sizeof (mbstate_t); 9 | } 10 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/csu/tst-empty.c: -------------------------------------------------------------------------------- 1 | /* The most useful C program known to man. */ 2 | 3 | static int 4 | do_test (void) 5 | { 6 | return 0; 7 | } 8 | #define TEST_FUNCTION do_test () 9 | #include "../test-skeleton.c" 10 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/gmon/tst-profile-static.c: -------------------------------------------------------------------------------- 1 | #include 2 | static int 3 | do_test (void) 4 | { 5 | puts ("Hello world"); 6 | return 0; 7 | } 8 | 9 | #define TEST_FUNCTION do_test () 10 | #include "../test-skeleton.c" 11 | -------------------------------------------------------------------------------- /libports/context-switch/tests/tst-setcontext-input.txt: -------------------------------------------------------------------------------- 1 | making contexts 2 | swapping contexts 3 | start f2 4 | &on_stack=0x1fb09f 5 | start f1(a0=1,a1=2,a2=3,a3=fffffffc) 6 | finish f2 7 | finish f1 8 | back at main program 9 | test succeeded 10 | -------------------------------------------------------------------------------- /locale/locale_patched/Makefile: -------------------------------------------------------------------------------- 1 | NAME=locale_patcher 2 | 3 | all: build 4 | sh add_all_patched_zrt_locales.sh 5 | 6 | 7 | build: locale_patcher.o 8 | $(CC) -o $(NAME) $(NAME).o 9 | 10 | 11 | clean: 12 | @rm $(NAME) $(NAME).o -fv 13 | @rm lib -rfv -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug15.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | char buf[10]; 8 | setlocale (LC_ALL, "vi_VN.TCVN-5712"); 9 | return sprintf (buf, "%.*s", 2, "vi") != 2; 10 | } 11 | -------------------------------------------------------------------------------- /libports/lua-5.2.1/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /tests/zrt_test_suite/tests/possible_slow_autotests/README: -------------------------------------------------------------------------------- 1 | tests in this folder possible are slow on some platforms due to Hardware/OS restriction. 2 | At least run these tests when testing whole toolchain build. 3 | For bigfile.c see https://github.com/zerovm/zrt/issues/65 -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-deep1mod1.c: -------------------------------------------------------------------------------- 1 | #include 2 | int 3 | foo (void) 4 | { 5 | printf ("%s:%s\n", __FILE__, __func__); 6 | return 1; 7 | } 8 | 9 | int 10 | baz (void) 11 | { 12 | printf ("%s:%s\n", __FILE__, __func__); 13 | return 20; 14 | } 15 | -------------------------------------------------------------------------------- /libports/context-switch/tests/tst-context-input.txt: -------------------------------------------------------------------------------- 1 | main: swapcontext(&uctx_main, &uctx_func2) 2 | func2: started 3 | func2: swapcontext(&uctx_func2, &uctx_func1) 4 | func1: started 5 | func1: swapcontext(&uctx_func1, &uctx_func2) 6 | func2: returning 7 | func1: returning 8 | main: exiting 9 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main (void) 5 | { 6 | int i; 7 | puts ("This should print \"wow = I\" for I from 0 to 39 inclusive."); 8 | for (i = 0; i < 40; i++) 9 | printf ("%s = %d\n", "wow", i); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/conf: -------------------------------------------------------------------------------- 1 | # $FreeBSD: src/tools/regression/fstest/tests/conf,v 1.1 2007/01/17 01:42:08 pjd Exp $ 2 | # fstest configuration file 3 | 4 | # Known operating systems: FreeBSD, SunOS, Linux 5 | os=`uname` 6 | 7 | # Known file systems: UFS, ZFS, ext3, ntfs-3g, xfs, zrtfs 8 | fs="zrtfs" 9 | -------------------------------------------------------------------------------- /lib/zrt.lo: -------------------------------------------------------------------------------- 1 | # zrt.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object=none 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='zrt.o' 12 | 13 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/api/stub-tag.h: -------------------------------------------------------------------------------- 1 | /* This header is included into every file that declares a stub function. 2 | It is obsolete now, but hasn't died to avoid removing all those 3 | #include's. Every such file should use the `stub_warning' macro for 4 | each of its functions, and that is sufficient. */ 5 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/tst-strfry.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int 5 | do_test (void) 6 | { 7 | char str[] = "this is a test"; 8 | 9 | strfry (str); 10 | 11 | return 0; 12 | } 13 | 14 | #define TEST_FUNCTION do_test () 15 | #include "../test-skeleton.c" 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/cleanup.sh: -------------------------------------------------------------------------------- 1 | find -name "*.nexe"| xargs rm -f 2 | find -name "*.std"| xargs rm -f 3 | find -name "*.log"| xargs rm -f 4 | find -name "*.o"| xargs rm -f 5 | find -name "*.manifest"| xargs rm -f 6 | find -name "*.scp"| xargs rm -f 7 | find -name "*.nvram"| xargs rm -f 8 | find -name "*.foo.tar"| xargs rm -f -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/libio/tst_wprintf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | fputws (L"Hello world!\n", stdout); 8 | wprintf (L"This %s a %ls string: %d\n", "is", L"mixed", 42); 9 | wprintf (L"%Iu\n", 0xfeedbeef); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/tst-array4.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define main array1_main 4 | #include "tst-array1.c" 5 | #undef main 6 | 7 | int 8 | main (void) 9 | { 10 | void *handle = dlopen ("tst-array2dep.so", RTLD_LAZY); 11 | 12 | array1_main (); 13 | 14 | if (handle != NULL) 15 | dlclose (handle); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/localedata/tst-leaks.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int cnt; 8 | 9 | mtrace (); 10 | 11 | for (cnt = 0; cnt < 100; ++cnt) 12 | { 13 | setlocale (LC_ALL, "de_DE.ISO-8859-1"); 14 | setlocale (LC_ALL, "de_DE.UTF-8"); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/nodlopen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | if (dlopen ("nodlopenmod.so", RTLD_LAZY) != NULL) 8 | { 9 | puts ("opening \"nodlopenmod.so\" succeeded, FAIL"); 10 | return 1; 11 | } 12 | 13 | puts ("opening \"nodlopenmod.so\" failed, OK"); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | int i,n,r; 8 | 9 | n = i = r = -1; 10 | r = sscanf ("1234:567", "%d%n", &i, &n); 11 | printf ("%d %d %d\n", r, n, i); 12 | if (r != 1 || i != 1234 || n != 4) 13 | abort (); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/crypt/md5c-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | const char salt[] = "$1$saltstring"; 8 | char *cp; 9 | int result = 0; 10 | 11 | cp = crypt ("Hello world!", salt); 12 | result |= strcmp ("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp); 13 | 14 | return result; 15 | } 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug21.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static int 4 | do_test (void) 5 | { 6 | static const char buf[] = " "; 7 | char *str; 8 | 9 | int r = sscanf (buf, "%as", &str); 10 | printf ("%d %p\n", r, str); 11 | 12 | return r != -1 || str != NULL; 13 | } 14 | 15 | #define TEST_FUNCTION do_test () 16 | #include "../test-skeleton.c" 17 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-tlsmod17b.c: -------------------------------------------------------------------------------- 1 | #define P(N) extern int tlsmod17a##N (void); 2 | #define PS P(0) P(1) P(2) P(3) P(4) P(5) P(6) P(7) P(8) P(9) \ 3 | P(10) P(12) P(13) P(14) P(15) P(16) P(17) P(18) P(19) 4 | PS 5 | #undef P 6 | 7 | int 8 | tlsmod17b (void) 9 | { 10 | int res = 0; 11 | #define P(N) res |= tlsmod17a##N (); 12 | PS 13 | #undef P 14 | return res; 15 | } 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug11.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | int ret; 8 | char buf [1024] = "Ooops"; 9 | 10 | ret = sscanf ("static char Term_bits[] = {", "static char %s = {", buf); 11 | printf ("ret: %d, name: %s\n", ret, buf); 12 | 13 | return strcmp (buf, "Term_bits[]") != 0 || ret != 1; 14 | } 15 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdlib/tst-putenv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int 5 | do_test (void) 6 | { 7 | char *p = getenv ("SOMETHING_NOBODY_USES"); 8 | if (p == NULL) 9 | { 10 | puts ("envvar not defined"); 11 | return 1; 12 | } 13 | 14 | return 0; 15 | } 16 | 17 | #define TEST_FUNCTION do_test () 18 | #include "../test-skeleton.c" 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/api/tst-audit.h: -------------------------------------------------------------------------------- 1 | /* Some machines have these macros defined in elf/tst-auditmod1.c directly. 2 | New machines can supply a tst-audit.h to define these macros used there. 3 | 4 | 5 | # define pltenter la_CPU_gnu_pltenter 6 | # define pltexit la_CPU_gnu_pltexit 7 | # define La_regs La_CPU_regs 8 | # define La_retval La_CPU_retval 9 | # define int_retval lrv_RETVALREG 10 | 11 | */ 12 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf10.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | const char teststring[] = ""; 8 | int retc, a, b; 9 | 10 | retc = sscanf (teststring, "<%*s `%n%*s%n'>", &a, &b); 11 | 12 | printf ("retc=%d a=%d b=%d\n", retc, a, b); 13 | 14 | return retc == -1 && a == 6 && b == 12 ? 0 : 1; 15 | } 16 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/13.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..2" 10 | 11 | expect EFAULT unlink NULL 12 | expect EFAULT unlink DEADCODE 13 | -------------------------------------------------------------------------------- /locale/locale_compiled/add_all_zrt_locales.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script read 'locales' file from current folder 4 | # and compiles all locales listed in that file also 5 | # applying patch and wrap every locale into tar archive 6 | 7 | LOCALES=locales 8 | 9 | value=0 10 | cat $LOCALES | while read line 11 | do 12 | #build pacthed localizations 13 | sh add_single_zrt_locale.sh $line 14 | done 15 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/12.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="mkfifo returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..2" 10 | 11 | expect EFAULT mkfifo NULL 0644 12 | expect EFAULT mkfifo DEADCODE 0644 13 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/09.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/09.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns EISDIR if the named file is a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 mkdir ${n0} 0755 14 | expect EISDIR truncate ${n0} 123 15 | expect 0 rmdir ${n0} 16 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/14.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/14.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..2" 10 | 11 | expect EFAULT truncate NULL 123 12 | expect EFAULT truncate DEADCODE 123 13 | -------------------------------------------------------------------------------- /libports/gtest/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | 3 | DEBUG=-g 4 | INCLUDE_FLAGS=-I$(ZRT_ROOT)/lib -I$(ZRT_ROOT)/zvm -I. 5 | CCFLAGS+=-DGTEST_HAS_PTHREAD=0 6 | 7 | all: libgtest.a 8 | 9 | libgtest.a: gtest-all.o 10 | @ar rcs libgtest.a gtest-all.o 11 | 12 | gtest-all.o: src/gtest-all.cc 13 | @$(CXX) -c -o gtest-all.o $(INCLUDE_FLAGS) $(DEBUG) src/gtest-all.cc 14 | 15 | clean: 16 | @rm -f libgtest.a *.o 17 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/10.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/10.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..2" 10 | 11 | expect EFAULT chown NULL 65534 65534 12 | expect EFAULT chown DEADCODE 65534 65534 13 | -------------------------------------------------------------------------------- /locale/locale_patched/add_all_patched_zrt_locales.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script read 'locales' file from current folder 4 | # and compiles all locales listed in that file also 5 | # applying patch and wrap every locale into tar archive 6 | 7 | LOCALES=../locales 8 | 9 | value=0 10 | cat $LOCALES | while read line 11 | do 12 | #build pacthed localizations 13 | sh add_single_patched_zrt_locale.sh $line 14 | done 15 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/dlfcn/bug-dlopen1.c: -------------------------------------------------------------------------------- 1 | /* Test case by Bruno Haible. It test whether the dynamic string 2 | token expansion can handle $ signs which do not start one of the 3 | recognized keywords. */ 4 | 5 | #include 6 | 7 | int 8 | main (void) 9 | { 10 | dlopen ("gnu-gettext-GetURL$1", RTLD_GLOBAL | RTLD_LAZY); 11 | dlopen ("gnu-gettext-GetURL${1", RTLD_GLOBAL | RTLD_LAZY); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/1: -------------------------------------------------------------------------------- 1 | legend: 2 | ZRT - zrt is responsible for supporting this 3 | ZEROVM - zerovm should add support 4 | 5 | glibc failed with folowing. 6 | - (ZRT) 7 | Regular expression tests: 8 | posix/tst-boost.c 9 | posix/tst-pcre.c 10 | - (ZEROVM) 11 | mmap tests: 12 | src/libio/tst-mmap-fflushsync.c 13 | - (ZRT) 14 | wide character FILE stream tests: 15 | src/libio/tst_putwc.c 16 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/02.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 rmdir ${name255} 13 | expect ENAMETOOLONG mkdir ${name256} 0755 14 | -------------------------------------------------------------------------------- /lib/mapreduce/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | CFLAGS+=-std=c99 -DDEBUG 3 | 4 | all: libmapreduce.a 5 | 6 | #use macros BASEFILE__ if no need full srcpath in log debug file 7 | %.o: %.c 8 | $(CC) $(CFLAGS) -DBASEFILE__=\"$(notdir $<)\" $< -o $@ 9 | 10 | libmapreduce.a: $(CURDIR)/buffer.o $(CURDIR)/map_reduce_lib.o 11 | @ar rcs libmapreduce.a buffer.o map_reduce_lib.o 12 | 13 | clean: 14 | @rm -f libmapreduce.a *.o 15 | 16 | -------------------------------------------------------------------------------- /locale/locale_compiled/localedef/mounts/fstab.conf: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | # ZRT fstab file, injects tar images contents into ZRT FS # 3 | ########################################################### 4 | 5 | #inject localization sources copy contents into "/" folder 6 | channel=/dev/mount/locales_i18n.tar, mountpoint=/ 7 | 8 | #inject growing array 9 | channel=/dev/locale-archive.tar, mountpoint=/ 10 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/math/test-matherr.c: -------------------------------------------------------------------------------- 1 | #undef _SVID_SOURCE 2 | #define _SVID_SOURCE 3 | #include 4 | #include 5 | #include 6 | 7 | static int fail = 1; 8 | 9 | int 10 | matherr (struct exception *s) 11 | { 12 | printf ("matherr is working\n"); 13 | fail = 0; 14 | return 1; 15 | } 16 | 17 | int 18 | main (void) 19 | { 20 | _LIB_VERSION = _SVID_; 21 | acos (2.0); 22 | return fail; 23 | } 24 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/time/bug-mktime1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | static int 6 | do_test (void) 7 | { 8 | struct tm t2 = { 0, 0, 0, 1, 1, 2050 - 1900, 1, 1, 1 }; 9 | time_t tt2 = mktime (&t2); 10 | printf ("%ld\n", (long int) tt2); 11 | if (sizeof (time_t) == 4 && tt2 != -1) 12 | return 1; 13 | return 0; 14 | } 15 | 16 | #define TEST_FUNCTION do_test () 17 | #include "../test-skeleton.c" 18 | -------------------------------------------------------------------------------- /tests/lua_test_suite/lua.nvram: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | # ZRT fstab file, injects tar images contents into ZRT FS # 3 | ########################################################### 4 | [fstab] 5 | channel=/dev/mount/root, mountpoint=/, access=ro, removable=no 6 | 7 | [args] 8 | args=lua.nexe -e_U=true /lua-5.2.1-tests/all.lua 9 | 10 | [env] 11 | name=PATH, value=foo 12 | 13 | [debug] 14 | verbosity=3 15 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/02.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | expect 0 mkfifo ${name255} 0644 12 | expect 0 unlink ${name255} 13 | expect ENAMETOOLONG mkfifo ${name256} 0644 14 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf8.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char *argv[]) 7 | { 8 | int ret; 9 | char buf [1024] = "Ooops"; 10 | 11 | ret = sscanf ("static char Term_bits[] = {", "static char %s = {", buf); 12 | printf ("ret: %d, name: %s\n", ret, buf); 13 | if (ret != 1 || strcmp (buf, "Term_bits[]") != 0) 14 | abort (); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/bug-strpbrk1.c: -------------------------------------------------------------------------------- 1 | /* Test case by Joseph S. Myers . */ 2 | #undef __USE_STRING_INLINES 3 | #define __USE_STRING_INLINES 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (int argc, char** argv) 10 | { 11 | const char *a = "abc"; 12 | const char *b = a; 13 | 14 | strpbrk (b++, ""); 15 | if (b != a + 1) 16 | return 1; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/bug-strspn1.c: -------------------------------------------------------------------------------- 1 | /* Test case by Joseph S. Myers . */ 2 | #undef __USE_STRING_INLINES 3 | #define __USE_STRING_INLINES 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (int argc, char** argv) 10 | { 11 | const char *a = "abc"; 12 | const char *b = a; 13 | 14 | strspn (b++, ""); 15 | if (b != a + 1) 16 | return 1; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/stdio-common/scanf12.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | double d; 8 | int c; 9 | 10 | if (scanf ("%lg", &d) != 0) 11 | { 12 | printf ("scanf didn't failed\n"); 13 | exit (1); 14 | } 15 | c = getchar (); 16 | if (c != ' ') 17 | { 18 | printf ("c is `%c', not ` '\n", c); 19 | exit (1); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/libs/lib21.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** compile with 3 | ** Linux: gcc -Wall -O2 -I.. -ansi -shared -o lib1.so lib1.c 4 | ** Mac OS X: export MACOSX_DEPLOYMENT_TARGET=10.3 5 | ** gcc -bundle -undefined dynamic_lookup -Wall -O2 -o lib1.so lib1.c 6 | */ 7 | 8 | 9 | #include "lua.h" 10 | 11 | 12 | int luaopen_lib2 (lua_State *L); 13 | 14 | int luaopen_lib21 (lua_State *L) { 15 | return luaopen_lib2(L); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/04.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ENOENT if a component of the path prefix does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT mkdir ${n0}/${n1}/test 0755 16 | expect 0 rmdir ${n0} 17 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-tlsmod18a.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef N 4 | # define N 0 5 | #endif 6 | 7 | static __thread int var = 4; 8 | 9 | int 10 | test (void) 11 | { 12 | int *p = &var; 13 | /* GCC assumes &var is never NULL, add optimization barrier. */ 14 | asm volatile ("" : "+r" (p)); 15 | if (p == NULL || *p != 4) 16 | { 17 | printf ("fail %d %p\n", N, p); 18 | return 1; 19 | } 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/libio/tst-sscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define WCS_LENGTH 256 5 | 6 | int 7 | main (void) 8 | { 9 | const char cnv[] ="%l[abc]"; 10 | const char str[] = "abbcXab"; 11 | wchar_t wcs[WCS_LENGTH]; 12 | int result = 0; 13 | 14 | sscanf (str, cnv, wcs); 15 | printf ("wcs = \"%ls\"\n", wcs); 16 | fflush (stdout); 17 | result = wcscmp (wcs, L"abbc") != 0; 18 | 19 | return result; 20 | } 21 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-setvbuf1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static int 4 | do_test (void) 5 | { 6 | if (setvbuf (stderr, NULL, _IOFBF, BUFSIZ) != 0) 7 | { 8 | puts ("Set full buffer error."); 9 | return 1; 10 | } 11 | 12 | fprintf (stderr, "Output #1 .\n"); 13 | printf ("Output #2 .\n"); 14 | 15 | return 0; 16 | } 17 | 18 | #define TEST_FUNCTION do_test () 19 | #include "../test-skeleton.c" 20 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/13.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..2" 12 | 13 | expect EFAULT chflags NULL UF_IMMUTABLE 14 | expect EFAULT chflags DEADCODE UF_IMMUTABLE 15 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/04.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ENOENT if a component of the path prefix does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT mkfifo ${n0}/${n1}/test 0644 16 | expect 0 rmdir ${n0} 17 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/04.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns ENOENT if the named directory does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 rmdir ${n0} 16 | expect ENOENT rmdir ${n0} 17 | expect ENOENT rmdir ${n1} 18 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/04.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns ENOENT if the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 create ${n0} 0644 15 | expect 0 unlink ${n0} 16 | expect ENOENT unlink ${n0} 17 | expect ENOENT unlink ${n1} 18 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-sscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define WCS_LENGTH 256 5 | 6 | int 7 | main (void) 8 | { 9 | const char cnv[] ="%l[abc]"; 10 | const char str[] = "abbcXab"; 11 | wchar_t wcs[WCS_LENGTH]; 12 | int result = 0; 13 | 14 | sscanf (str, cnv, wcs); 15 | printf ("wcs = \"%ls\"\n", wcs); 16 | fflush (stdout); 17 | result = wcscmp (wcs, L"abbc") != 0; 18 | 19 | return result; 20 | } 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/02.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 rmdir ${name255} 13 | expect ENOENT rmdir ${name255} 14 | expect ENAMETOOLONG rmdir ${name256} 15 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/04.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ENOENT if a component of the name2 path prefix does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT symlink test ${n0}/${n1}/test 16 | expect 0 rmdir ${n0} 17 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/02.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | expect 0 create ${name255} 0644 12 | expect 0 unlink ${name255} 13 | expect ENOENT unlink ${name255} 14 | expect ENAMETOOLONG unlink ${name256} 15 | -------------------------------------------------------------------------------- /tests/zrt_test_suite/mounts/fstab.conf: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | # ZRT fstab file, injects tar images contents into ZRT FS # 3 | ########################################################### 4 | 5 | #inject glibc localization files in two separated tar images. 6 | #copy contents into "/lib" folder 7 | channel=/dev/mount/lib, mountpoint=/lib 8 | 9 | #copy contents into "/share" folder 10 | channel=/dev/mount/share, mountpoint=/share 11 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdlib/tst-atof1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | char buf[100]; 9 | snprintf (buf, sizeof (buf), "%g", atof ("0x10p-1")); 10 | if (strcmp (buf, "8") != 0) 11 | { 12 | printf ("got \"%s\", expected \"8\"\n", buf); 13 | return 1; 14 | } 15 | return 0; 16 | } 17 | 18 | #define TEST_FUNCTION do_test () 19 | #include "../test-skeleton.c" 20 | -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/libs/lib11.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** compile with 3 | ** Linux: gcc -Wall -O2 -I.. -ansi -shared -o lib1.so lib1.c 4 | ** Mac OS X: export MACOSX_DEPLOYMENT_TARGET=10.3 5 | ** gcc -bundle -undefined dynamic_lookup -Wall -O2 -o lib1.so lib1.c 6 | */ 7 | 8 | 9 | #include "lua.h" 10 | 11 | /* function from lib1.c */ 12 | int lib1_export (lua_State *L); 13 | 14 | int luaopen_lib11 (lua_State *L) { 15 | return lib1_export(L); 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/13.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns EINVAL if the length argument was less than 0" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | expect EINVAL -- truncate ${n0} -1 15 | expect EINVAL -- truncate ${n0} -999999 16 | expect 0 unlink ${n0} 17 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/04.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns ENOENT if the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT chmod ${n0}/${n1}/test 0644 16 | expect ENOENT chmod ${n0}/${n1} 0644 17 | expect 0 rmdir ${n0} 18 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of GNU tar. 2 | 3 | The following contributions warranted legal paper exchanges with the 4 | Free Software Foundation. Also see files ChangeLog and THANKS. 5 | 6 | TAR Jay Fenlason 7 | Assigns his changes. 8 | 9 | TAR Richard E Salz 3/11/93 10 | Disclaims changes to getdate.y. 11 | 12 | From: assign@gnu.ai.mit.edu 13 | Date: Fri, 27 Jan 95 18:13:46 est 14 | TAR MANUAL (?) Amy Gorin (US 1963) 1/10/95 15 | Assigns the Tar Manual. 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int argc, char *argv[]) 6 | { 7 | int a, b; 8 | 9 | a = b = -1; 10 | sscanf ("12ab", "%dab%n", &a, &b); 11 | printf ("%d, %d\n", a, b); 12 | if (a != 12 || b != 4) 13 | abort (); 14 | 15 | a = b = -1; 16 | sscanf ("12ab100", "%dab%n100", &a, &b); 17 | printf ("%d, %d\n", a, b); 18 | if (a != 12 || b != 4) 19 | abort (); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/09.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/09.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns ENOENT if the source file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 create ${n0} 0644 15 | expect 0 link ${n0} ${n1} 16 | expect 0 unlink ${n0} 17 | expect 0 unlink ${n1} 18 | expect ENOENT link ${n0} ${n1} 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-wc-printf.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 1 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int 8 | main (void) 9 | { 10 | wchar_t tmp[3]; 11 | tmp[0] = '8'; 12 | tmp[1] = '1'; 13 | tmp[2] = 0; 14 | 15 | printf ("Test for wide character output with printf\n"); 16 | 17 | printf ("with %%S: %S\n", tmp); 18 | 19 | printf ("with %%C: %C\n", (wint_t) tmp[0]); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/04.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns ENOENT if the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT chown ${n0}/${n1}/test 65534 65534 16 | expect ENOENT chown ${n0}/${n1} 65534 65534 17 | expect 0 rmdir ${n0} 18 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/04.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ENOENT if the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect ENOENT truncate ${n0}/${n1}/test 123 16 | expect ENOENT truncate ${n0}/${n1} 123 17 | expect 0 rmdir ${n0} 18 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/localisation/generator.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #it's parses alias file and based on it's data 4 | #it prints commands to invoke in terminal to compile 5 | #example of single locale of output: 6 | #localedef -i hr_HR -f ISO-8859-2 ./hr_HR.ISO-8859-2 7 | awk '{ \ 8 | #skip comments #... \ 9 | if ( $0 !~ /#/ && NF==2) { 10 | split($2, params, ".");\ 11 | print "localedef -i ",params[1], "-f", params[2], "./localedata/"$2 \ 12 | }\ 13 | 14 | }' share/locale.alias 15 | 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execl1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | static const char prog[] = "does-not-exist"; 9 | errno = 0; 10 | execl (prog, prog, NULL); 11 | 12 | if (errno != ENOENT) 13 | { 14 | printf ("errno = %d (%m), expected ENOENT\n", errno); 15 | return 1; 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | #define TEST_FUNCTION do_test () 22 | #include "../test-skeleton.c" 23 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/02.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | expect 0 create ${name255} 0644 12 | expect 0 chmod ${name255} 0620 13 | expect 0620 stat ${name255} mode 14 | expect 0 unlink ${name255} 15 | expect ENAMETOOLONG chmod ${name256} 0620 16 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execv1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | char *argv[] = { (char *) "does-not-exist", NULL }; 9 | errno = 0; 10 | execv (argv[0], argv); 11 | 12 | if (errno != ENOENT) 13 | { 14 | printf ("errno = %d (%m), expected ENOENT\n", errno); 15 | return 1; 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | #define TEST_FUNCTION do_test () 22 | #include "../test-skeleton.c" 23 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/malloc/tst-valloc.c: -------------------------------------------------------------------------------- 1 | /* Test case by Stephen Tweedie . */ 2 | #include 3 | #include 4 | #include 5 | 6 | int 7 | main (void) 8 | { 9 | char *p; 10 | int pagesize = getpagesize (); 11 | int i; 12 | 13 | p = valloc (pagesize); 14 | i = (long int) p; 15 | 16 | if ((i & (pagesize-1)) != 0) 17 | { 18 | fprintf (stderr, "Alignment problem: valloc returns %p\n", p); 19 | exit (1); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/wcsmbs/wcsatcliff.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define WCSTEST 1 4 | #define L(c) L##c 5 | #define CHAR wchar_t 6 | #define MEMSET wmemset 7 | #define STRLEN wcslen 8 | #define STRNLEN wcsnlen 9 | #define STRCHR wcschr 10 | #define STRRCHR wcsrchr 11 | #define STRCPY wcscpy 12 | #define STRNCPY wcsncpy 13 | #define MEMCMP wmemcmp 14 | #define STPCPY wcpcpy 15 | #define STPNCPY wcpncpy 16 | #define MEMCPY wmemcpy 17 | #define MEMPCPY wmempcpy 18 | 19 | 20 | #include "../string/stratcliff.c" 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/02.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | expect 0 create ${name255} 0644 12 | expect 0 truncate ${name255} 123 13 | expect 123 stat ${name255} size 14 | expect 0 unlink ${name255} 15 | expect ENAMETOOLONG truncate ${name256} 123 16 | -------------------------------------------------------------------------------- /libports/context-switch/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ZVSH="python zvsh" 3 | 4 | for file in tst-* 5 | do 6 | OUT=tests/$file-output.txt 7 | INPUT=tests/$file-input.txt 8 | 9 | $ZVSH $file > $OUT 10 | diff $INPUT $OUT > /dev/null 2>&1 11 | 12 | if [ $? == 0 ]; then 13 | echo -e "\033[01;32mPassed\033[00m" 14 | else 15 | echo -e "\033[01;31mFailed\033[00m" 16 | echo -e "\033[01;37mExpected output:\033[00m" 17 | cat $INPUT 18 | echo -e "\033[01;37mActual output:\033[00m" 19 | cat $OUT 20 | fi 21 | rm $OUT 22 | done -------------------------------------------------------------------------------- /tests/daemon_client.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import sys 3 | 4 | server_address = sys.argv[1] 5 | sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) 6 | try: 7 | sock.connect(server_address) 8 | data = sys.stdin.read() 9 | size = '0x%06x' % (len(data)) 10 | sock.sendall(size + data) 11 | resp = sock.makefile() 12 | data = resp.read(8) 13 | size = int(data, 0) 14 | data = resp.read(size) 15 | print data 16 | except IOError, e: 17 | print str(e) 18 | finally: 19 | sock.close() 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug9.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int argc, char *argv[]) 6 | { 7 | char buf[100]; 8 | int a, b; 9 | int status = 0; 10 | 11 | sscanf ("12ab", "%dab%n", &a, &b); 12 | sprintf (buf, "%d, %d", a, b); 13 | puts (buf); 14 | status |= strcmp (buf, "12, 4"); 15 | 16 | sscanf ("12ab100", "%dab%n100", &a, &b); 17 | sprintf (buf, "%d, %d", a, b); 18 | puts (buf); 19 | status |= strcmp (buf, "12, 4"); 20 | 21 | return status; 22 | } 23 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/todo/README: -------------------------------------------------------------------------------- 1 | gmp 2 | math/atest-sincos require libgmp (absent headers) seems to be should be ported 3 | stdio-common/scanf.c require libiop (absent libioP.h) 4 | posix/bug-regex5.c (absent localeinfo.h) 5 | posix/bug-regex20.c (absent regex_internal.h) 6 | 7 | crypt/testmd5.c (absent md5.h) 8 | crypt/sha512test.c (absent sha512.h) 9 | crypt/sha256test.c (absent sha256.h) 10 | 11 | iconvdata/bug-iconv3.c (dlopen should be supported to load shared iconv libraries) 12 | libio/tst-swscanf.c (locale "C" only works ) -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/elf/tst-dlmopen3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | static int 6 | do_test (void) 7 | { 8 | void *h = dlmopen (LM_ID_NEWLM, "$ORIGIN/tst-dlmopen1mod.so", RTLD_LAZY); 9 | if (h == NULL) 10 | { 11 | printf ("cannot get handle for %s: %s\n", 12 | "tst-dlmopen1mod.so", dlerror ()); 13 | return 1; 14 | } 15 | 16 | /* Do not unload. */ 17 | 18 | return 0; 19 | } 20 | 21 | #define TEST_FUNCTION do_test () 22 | #include "../test-skeleton.c" 23 | -------------------------------------------------------------------------------- /tests/lua_test_suite/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source $ZRT_ROOT/run.env 3 | 4 | SCRIPT=$(readlink -f "$0") 5 | SCRIPT_PATH=`dirname "$SCRIPT"` 6 | LUA_TEST_PATH=$SCRIPT_PATH/lua-5.2.1-tests 7 | 8 | #create tarfs 9 | sh create-tar.sh 10 | 11 | #Generate from template 12 | sed s@{ABS_PATH}@$SCRIPT_PATH/@g lua.manifest.template | \ 13 | sed s@{LUA_TEST_PATH}@$LUA_TEST_PATH/@g > lua.manifest 14 | 15 | echo some input text > lua.input 16 | ${ZEROVM} $SCRIPT_PATH/lua.manifest 17 | cat lua.output 18 | cat lua.log 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/01.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR unlink ${n0}/${n1}/test 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/tst-leaks1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int 7 | main (void) 8 | { 9 | mtrace (); 10 | 11 | int ret = 0; 12 | for (int i = 0; i < 10; i++) 13 | { 14 | void *h = dlopen (i < 5 ? "./tst-leaks1.c" 15 | : "$ORIGIN/tst-leaks1.o", RTLD_LAZY); 16 | if (h != NULL) 17 | { 18 | puts ("dlopen unexpectedly succeeded"); 19 | ret = 1; 20 | dlclose (h); 21 | } 22 | } 23 | 24 | return ret; 25 | } 26 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/tst-cpucount.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int 5 | do_test (void) 6 | { 7 | cpu_set_t c; 8 | 9 | CPU_ZERO (&c); 10 | 11 | for (int cnt = 0; cnt < 130; ++cnt) 12 | { 13 | int n = CPU_COUNT (&c); 14 | if (n != cnt) 15 | { 16 | printf ("expected %d, not %d\n", cnt, n); 17 | return 1; 18 | } 19 | 20 | CPU_SET (cnt, &c); 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | #define TEST_FUNCTION do_test () 27 | #include "../test-skeleton.c" 28 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/04.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns ENOENT if the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..4" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | expect ENOENT chflags ${n0}/${n1}/test UF_IMMUTABLE 18 | expect ENOENT chflags ${n0}/${n1} UF_IMMUTABLE 19 | expect 0 rmdir ${n0} 20 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/01.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR chmod ${n0}/${n1}/test 0644 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/02.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | expect 0 create ${name255} 0644 12 | expect 0 chown ${name255} 65534 65534 13 | expect 65534,65534 stat ${name255} uid,gid 14 | expect 0 unlink ${name255} 15 | expect ENAMETOOLONG chown ${name256} 65533 65533 16 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/01.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR mkdir ${n0}/${n1}/test 0755 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/01.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR mkfifo ${n0}/${n1}/test 0644 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/01.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR chown ${n0}/${n1}/test 65534 65534 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf7.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | long long int n; 8 | int ret; 9 | 10 | n = -1; 11 | ret = sscanf ("1000", "%lld", &n); 12 | printf ("%%lld: ret: %d, n: %Ld\n", ret, n); 13 | if (ret != 1 || n != 1000L) 14 | abort (); 15 | 16 | n = -2; 17 | ret = sscanf ("1000", "%llld", &n); 18 | printf ("%%llld: ret: %d, n: %Ld\n", ret, n); 19 | if (ret > 0 || n >= 0L) 20 | abort (); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/15.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/15.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..2" 12 | else 13 | echo "1..1" 14 | fi 15 | 16 | expect EFAULT rmdir NULL 17 | if [ "${fs}" != "zrtfs" ] 18 | then 19 | expect EFAULT rmdir DEADCODE 20 | fi 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/01.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ENOTDIR if a component of the name2 path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR symlink test ${n0}/${n1}/test 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/01.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | expect ENOTDIR truncate ${n0}/${n1}/test 123 17 | expect 0 unlink ${n0}/${n1} 18 | expect 0 rmdir ${n0} 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/api/ztests64_compatibility.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZTESTS_64_COMPATIBILITY_H__ 2 | #define __ZTESTS_64_COMPATIBILITY_H__ 3 | 4 | #define off64_t off_t 5 | #define ftello64 ftell 6 | #define stat64 stat 7 | #define fopen64 fopen 8 | #define fseeko64 fseek 9 | #define lseek64 lseek 10 | #define rlimit64 rlimit 11 | #define mkstemp64 mkstemp 12 | #define getrlimit64 getrlimit 13 | #define setrlimit64 setrlimit 14 | #define ftw64 ftw 15 | 16 | //filename: "ztests64_compatibility.h" 17 | 18 | #endif //__ZTESTS_64_COMPATIBILITY_H__ 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/17.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/17.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ENXIO when O_NONBLOCK is set, the named file is a fifo, O_WRONLY is set, and no process has the file open for reading" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | quick_exit #zrtfs not support pipes 10 | 11 | echo "1..3" 12 | 13 | n0=`namegen` 14 | 15 | expect 0 mkfifo ${n0} 0644 16 | expect ENXIO open ${n0} O_WRONLY,O_NONBLOCK 17 | expect 0 unlink ${n0} 18 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/10.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/10.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..2" 12 | else 13 | echo "1..1" 14 | fi 15 | 16 | expect EFAULT chmod NULL 0644 17 | if [ "${fs}" != "zrtfs" ] 18 | then 19 | expect EFAULT chmod DEADCODE 0644 20 | fi 21 | -------------------------------------------------------------------------------- /lib/networking/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | CFLAGS+=-std=c99 -I. -I.. 3 | CFLAGS+=-DDEBUG -g 4 | 5 | all: libnetworking.a 6 | 7 | #use macros BASEFILE__ if no need full srcpath in log debug file 8 | %.o: %.c 9 | $(CC) $(CFLAGS) -DBASEFILE__=\"$(notdir $<)\" $< -o $@ 10 | 11 | libnetworking.a: \ 12 | $(CURDIR)/eachtoother_comm.o \ 13 | $(CURDIR)/channels_conf.o \ 14 | $(CURDIR)/channels_conf_reader.o 15 | @ar rcs libnetworking.a eachtoother_comm.o channels_conf.o channels_conf_reader.o 16 | 17 | clean: 18 | @rm -f *.a *.o 19 | 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-tlsmod17a.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef N 4 | #define N 0 5 | #endif 6 | #define CONCAT1(s, n) s##n 7 | #define CONCAT(s, n) CONCAT1(s, n) 8 | 9 | __thread int CONCAT (v, N) = 4; 10 | 11 | int 12 | CONCAT (tlsmod17a, N) (void) 13 | { 14 | int *p = &CONCAT (v, N); 15 | /* GCC assumes &var is never NULL, add optimization barrier. */ 16 | asm volatile ("" : "+r" (p)); 17 | if (p == NULL || *p != 4) 18 | { 19 | printf ("fail %d %p\n", N, p); 20 | return 1; 21 | } 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/io/bug-ftw5.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | fn (const char *file, const struct stat *sb, int flag, struct FTW *s) 7 | { 8 | puts (file); 9 | return FTW_STOP; 10 | } 11 | 12 | static int 13 | do_test (void) 14 | { 15 | if (nftw ("/", fn, 0, FTW_CHDIR | FTW_ACTIONRETVAL) < 0) 16 | { 17 | printf ("nftw / FTW_CHDIR: %m\n"); 18 | return 1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | #define TEST_FUNCTION do_test () 25 | #include "../test-skeleton.c" 26 | -------------------------------------------------------------------------------- /contrib/jenkins/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export ZVM_PREFIX=$HOME/zvm-root 3 | export ZRT_ROOT=$HOME/zrt 4 | export LD_LIBRARY_PATH=/usr/lib64 5 | export CPATH="/usr/x86_64-nacl/include:$HOME/libffi/x86_64-pc-nacl/include" 6 | export PATH="$PATH:$ZVM_PREFIX/bin" 7 | 8 | # Copy the current clone of zrt from the shared dir to another working 9 | # directory 10 | rsync -az --exclude=contrib/jenkins/.* /host-workspace/ $ZRT_ROOT 11 | 12 | # Make zerovm available in path 13 | ln -s `which zerovm` $ZVM_PREFIX/bin/zerovm 14 | 15 | cd $ZRT_ROOT 16 | make 17 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execle1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | static const char prog[] = "does-not-exist"; 9 | const char *env [] = {"FOO=BAR", NULL}; 10 | errno = 0; 11 | execle (prog, prog, NULL, env); 12 | 13 | if (errno != ENOENT) 14 | { 15 | printf ("errno = %d (%m), expected ENOENT\n", errno); 16 | return 1; 17 | } 18 | 19 | return 0; 20 | } 21 | 22 | #define TEST_FUNCTION do_test () 23 | #include "../test-skeleton.c" 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/run_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FIFO_FOR_OUTPUT=data/fstest.fifo.output 4 | FIFO_FOR_INPUT=data/fstest.fifo.input 5 | STDIN=data/fstest.stdin.data 6 | STDOUT=data/fstest.stdout.data 7 | STDERR=data/fstest.stderr.data 8 | ZEROVM_OUTPUT=data/zerovm.output 9 | 10 | if [ $# -lt 1 ] 11 | then 12 | echo "required tests path argument, for example:" 13 | echo "sh run_test.sh "tests -r -f"" 14 | exit 15 | fi 16 | 17 | rm -f $STDIN $STDOUT $STDERR $ZEROVM_OUTPUT $FIFO_FOR_INPUT $FIFO_FOR_OUTPUT 18 | prove ""$1"" 19 | ./kill_fstest.sh 20 | 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/07.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 symlink ${n0} ${n1} 15 | expect 0 symlink ${n1} ${n0} 16 | expect ELOOP unlink ${n0}/test 17 | expect ELOOP unlink ${n1}/test 18 | expect 0 unlink ${n0} 19 | expect 0 unlink ${n1} 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execve1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | char *argv[] = { (char *) "does-not-exist", NULL }; 9 | char *envp[] = { (char *) "FOO=BAR", NULL }; 10 | errno = 0; 11 | execve (argv[0], argv, envp); 12 | 13 | if (errno != ENOENT) 14 | { 15 | printf ("errno = %d (%m), expected ENOENT\n", errno); 16 | return 1; 17 | } 18 | 19 | return 0; 20 | } 21 | 22 | #define TEST_FUNCTION do_test () 23 | #include "../test-skeleton.c" 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/01.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..5" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | expect 0 create ${n0}/${n1} 0644 18 | expect ENOTDIR chflags ${n0}/${n1}/test UF_IMMUTABLE 19 | expect 0 unlink ${n0}/${n1} 20 | expect 0 rmdir ${n0} 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/11.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ETXTBSY the file is a pure procedure (shared text) file that is being executed" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..2" 12 | 13 | n0=`namegen` 14 | 15 | cp -pf `which sleep` ${n0} 16 | ./${n0} 3 & 17 | expect ETXTBSY truncate ${n0} 123 18 | expect 0 unlink ${n0} 19 | ;; 20 | *) 21 | quick_exit 22 | ;; 23 | esac 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/04.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns ENOENT if a component of either path prefix does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect ENOENT link ${n0}/${n1}/test ${n2} 17 | expect 0 create ${n2} 0644 18 | expect ENOENT link ${n2} ${n0}/${n1}/test 19 | expect 0 unlink ${n2} 20 | expect 0 rmdir ${n0} 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/07.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 symlink ${n0} ${n1} 15 | expect 0 symlink ${n1} ${n0} 16 | expect ELOOP mkfifo ${n0}/test 0644 17 | expect ELOOP mkfifo ${n1}/test 0644 18 | expect 0 unlink ${n0} 19 | expect 0 unlink ${n1} 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/testobj.h: -------------------------------------------------------------------------------- 1 | extern int preload (int a); 2 | 3 | extern int foo (int); 4 | 5 | extern int obj1func1 (int); 6 | 7 | extern int obj1func2 (int); 8 | 9 | extern int obj2func1 (int); 10 | 11 | extern int obj2func2 (int); 12 | 13 | extern int obj3func1 (int); 14 | 15 | extern int obj3func2 (int); 16 | 17 | extern int obj4func1 (int); 18 | 19 | extern int obj4func2 (int); 20 | 21 | extern int obj5func1 (int); 22 | 23 | extern int obj5func2 (int); 24 | 25 | extern int obj6func1 (int); 26 | 27 | extern int obj6func2 (int); 28 | 29 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/argp/bug-argp1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | static const struct argp_option test_options[] = 5 | { 6 | { NULL, 'a', NULL, OPTION_DOC, NULL }, 7 | { NULL, 'b', NULL, OPTION_DOC, NULL }, 8 | { NULL, 0, NULL, 0, NULL } 9 | }; 10 | 11 | static struct argp test_argp = 12 | { 13 | test_options 14 | }; 15 | 16 | 17 | static int 18 | do_test (int argc, char *argv[]) 19 | { 20 | int i; 21 | argp_parse (&test_argp, argc, argv, 0, &i, NULL); 22 | return 0; 23 | } 24 | 25 | #define TEST_FUNCTION do_test (argc, argv) 26 | #include "../test-skeleton.c" 27 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/06.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 symlink ${n0} ${n1} 15 | expect 0 symlink ${n1} ${n0} 16 | expect ELOOP chown ${n0}/test 65534 65534 17 | expect ELOOP chown ${n1}/test 65534 65534 18 | expect 0 unlink ${n0} 19 | expect 0 unlink ${n1} 20 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/07.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 symlink ${n0} ${n1} 15 | expect 0 symlink ${n1} ${n0} 16 | expect ELOOP truncate ${n0}/test 123 17 | expect ELOOP truncate ${n1}/test 123 18 | expect 0 unlink ${n0} 19 | expect 0 unlink ${n1} 20 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/07.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ELOOP if too many symbolic links were encountered in translating the name2 path name" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 symlink ${n0} ${n1} 15 | expect 0 symlink ${n1} ${n0} 16 | expect ELOOP symlink test ${n0}/test 17 | expect ELOOP symlink test ${n1}/test 18 | expect 0 unlink ${n0} 19 | expect 0 unlink ${n1} 20 | -------------------------------------------------------------------------------- /cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #It's dangerous to your files to make changes here 3 | echo removing files listed below 4 | 5 | find -name "*.nexe" 6 | find -name "*.nexe" | xargs rm -f 7 | 8 | find -name "*.a" 9 | find -name "*.a" | xargs rm -f 10 | 11 | find -name "*.o" 12 | find -name "*.o" | xargs rm -f 13 | 14 | find -name "*~" 15 | find -name "*~" | xargs rm -f 16 | 17 | find -name "*.log" 18 | find -name "*.log" | xargs rm -f 19 | 20 | find -name "*.std" 21 | find -name "*.std" | xargs rm -f 22 | 23 | find -name "*.log" 24 | find -name "*.log" | xargs rm -f 25 | 26 | echo cleanup completed -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/tst-strtok.c: -------------------------------------------------------------------------------- 1 | /* Testcase for strtok reported by Andrew Church . */ 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char** argv) 7 | { 8 | char buf[1] = { 0 }; 9 | int result = 0; 10 | 11 | if (strtok (buf, " ") != NULL) 12 | { 13 | puts ("first strtok call did not return NULL"); 14 | result = 1; 15 | } 16 | else if (strtok (NULL, " ") != NULL) 17 | { 18 | puts ("second strtok call did not return NULL"); 19 | result = 1; 20 | } 21 | 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/wcsmbs/tst-wcstof.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 1 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int 8 | main (int argc, char** argv) 9 | { 10 | int result = 0; 11 | char buf[100]; 12 | wchar_t tmp[3]; 13 | tmp[0] = '8'; 14 | tmp[1] = '1'; 15 | tmp[2] = 0; 16 | 17 | snprintf (buf, 100, "%S = %f", tmp, wcstof (tmp, NULL)); 18 | printf ("\"%s\" -> %s\n", buf, 19 | strcmp (buf, "81 = 81.000000") == 0 ? "okay" : "buggy"); 20 | result |= strcmp (buf, "81 = 81.000000") != 0; 21 | 22 | return result; 23 | } 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/02.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..6" 12 | 13 | expect 0 create ${name255} 0644 14 | expect 0 chflags ${name255} UF_IMMUTABLE 15 | expect UF_IMMUTABLE stat ${name255} flags 16 | expect 0 chflags ${name255} none 17 | expect 0 unlink ${name255} 18 | expect ENAMETOOLONG chflags ${name256} UF_IMMUTABLE 19 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/18.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/18.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EINVAL when the 'from' argument is a parent directory of 'to'" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect 0 mkdir ${n0}/${n1} 0755 17 | 18 | expect EINVAL rename ${n0} ${n0}/${n1} 19 | expect EINVAL rename ${n0} ${n0}/${n1}/${n2} 20 | 21 | expect 0 rmdir ${n0}/${n1} 22 | expect 0 rmdir ${n0} 23 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/02.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ENAMETOOLONG if a component of the name2 pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..7" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 symlink ${name255} ${n0} 14 | expect 0 unlink ${n0} 15 | expect 0 symlink ${n0} ${name255} 16 | expect 0 unlink ${name255} 17 | 18 | expect ENAMETOOLONG symlink ${n0} ${name256} 19 | expect 0 symlink ${name256} ${n0} 20 | expect 0 unlink ${n0} 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/12.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns EFAULT if one of the pathnames specified is outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | 13 | expect EFAULT symlink NULL ${n0} 14 | expect EFAULT symlink DEADCODE ${n0} 15 | expect EFAULT symlink test NULL 16 | expect EFAULT symlink test DEADCODE 17 | expect EFAULT symlink NULL DEADCODE 18 | expect EFAULT symlink DEADCODE NULL 19 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/include/tst-array5dep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void 5 | init_0 (int argc __attribute__ ((unused)), char **argv) 6 | { 7 | char *p = strrchr (argv [0], '/'); 8 | 9 | if (p == NULL) 10 | return; 11 | 12 | p++; 13 | size_t len = strlen (p); 14 | write (STDOUT_FILENO, "init array in DSO: ", 19); 15 | write (STDOUT_FILENO, p, len); 16 | write (STDOUT_FILENO, "\n", 1); 17 | } 18 | 19 | void (*const init_array []) (int, char **) 20 | __attribute__ ((section (".init_array"), aligned (sizeof (void *)))) = 21 | { 22 | &init_0, 23 | }; 24 | -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/libs/lib2.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** compile with 3 | ** gcc -Wall -O2 -I.. -ansi -shared -o lib1.so lib1.c 4 | */ 5 | 6 | 7 | #include "lua.h" 8 | #include "lauxlib.h" 9 | 10 | static int id (lua_State *L) { 11 | return lua_gettop(L); 12 | } 13 | 14 | 15 | static const struct luaL_Reg funcs[] = { 16 | {"id", id}, 17 | {NULL, NULL} 18 | }; 19 | 20 | 21 | int luaopen_lib2 (lua_State *L) { 22 | lua_settop(L, 2); 23 | lua_setglobal(L, "y"); /* y gets 2nd parameter */ 24 | lua_setglobal(L, "x"); /* x gets 1st parameter */ 25 | luaL_newlib(L, funcs); 26 | return 1; 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/06.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..6" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 symlink ${n0} ${n1} 17 | expect 0 symlink ${n1} ${n0} 18 | expect ELOOP chflags ${n0}/test UF_IMMUTABLE 19 | expect ELOOP chflags ${n1}/test UF_IMMUTABLE 20 | expect 0 unlink ${n0} 21 | expect 0 unlink ${n1} 22 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/12.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "$fs" != "zrtfs" ] 10 | then 11 | echo "1..2" 12 | else 13 | echo "1..1" 14 | fi 15 | 16 | expect EFAULT mkdir NULL 0755 17 | if [ "$fs" != "zrtfs" ] #zrt has no API to check invalid pointer; 1 test excluded 18 | then 19 | 20 | expect EFAULT mkdir DEADCODE 0755 21 | fi 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/12.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | quick_exit #zrtfs not support symlink 10 | 11 | echo "1..6" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 symlink ${n0} ${n1} 17 | expect 0 symlink ${n1} ${n0} 18 | expect ELOOP open ${n0}/test O_RDONLY 19 | expect ELOOP open ${n1}/test O_RDONLY 20 | expect 0 unlink ${n0} 21 | expect 0 unlink ${n1} 22 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/03.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ENOENT if a component of the 'from' path does not exist, or a path prefix of 'to' does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect ENOENT rename ${n0}/${n1}/test ${n2} 17 | expect 0 create ${n2} 0644 18 | expect ENOENT rename ${n2} ${n0}/${n1}/test 19 | expect 0 unlink ${n2} 20 | expect 0 rmdir ${n0} 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/08.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns EEXIST if the name2 argument already exists" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..9" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | expect EEXIST symlink test ${n0} 15 | expect 0 unlink ${n0} 16 | 17 | expect 0 mkdir ${n0} 0755 18 | expect EEXIST symlink test ${n0} 19 | expect 0 rmdir ${n0} 20 | 21 | expect 0 symlink test ${n0} 22 | expect EEXIST symlink test ${n0} 23 | expect 0 unlink ${n0} 24 | -------------------------------------------------------------------------------- /libports/sqlite3/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | 3 | #path add for includes 4 | CFLAGS+=-I. 5 | CFLAGS+=-O2 -std=c99 6 | 7 | #sqlite debugging 8 | #CFLAGS+= \ 9 | -DSQLITE_TEST \ 10 | -DSQLITE_DEBUG \ 11 | -DSQLITE_ENABLE_IOTRACE \ 12 | -DSQLITE_DEBUG_OS_TRACE \ 13 | -DSQLITE_LOCK_TRACE 14 | 15 | #set required macroses 16 | CFLAGS+=-DSQLITE_THREADSAFE=0 17 | CFLAGS+=-DSQLITE_OMIT_LOAD_EXTENSION 18 | #CFLAGS+=-DSQLITE_IGNORE_FLOCK_LOCK_ERRORS 19 | 20 | libsqlite3.a: sqlite3.o vfs_channel.o 21 | @$(AR) rcs libsqlite3.a sqlite3.o vfs_channel.o 22 | 23 | clean: 24 | @rm -f libsqlite3.a vfs_channel.o sqlite3.o 25 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug10.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main (int arc, char *argv[]) 5 | { 6 | int n, res; 7 | unsigned int val; 8 | char s[] = "111"; 9 | int result = 0; 10 | 11 | n = 0; 12 | res = sscanf(s, "%u %n", &val, &n); 13 | 14 | printf("Result of sscanf = %d\n", res); 15 | printf("Scanned format %%u = %u\n", val); 16 | printf("Possibly scanned format %%n = %d\n", n); 17 | result |= res != 1 || val != 111 || n != 3; 18 | 19 | 20 | result |= sscanf ("", " %n", &n) == EOF; 21 | 22 | puts (result ? "Test failed" : "All tests passed"); 23 | 24 | return result; 25 | } 26 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/time/tst_wcsftime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (int argc, char *argv[]) 6 | { 7 | wchar_t buf[200]; 8 | time_t t; 9 | struct tm *tp; 10 | int result = 0; 11 | size_t n; 12 | 13 | time (&t); 14 | tp = gmtime (&t); 15 | 16 | n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]), 17 | L"%H:%M:%S %Y-%m-%d\n", tp); 18 | if (n != 21) 19 | result = 1; 20 | 21 | wprintf (L"It is now %ls", buf); 22 | 23 | wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A\n", tp); 24 | 25 | wprintf (L"The weekday is %ls", buf); 26 | 27 | return result; 28 | } 29 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/misc/tst-hsearch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | int a = 1; 8 | int b = 2; 9 | ENTRY i; 10 | ENTRY *e; 11 | 12 | if (hcreate (20) == 0) 13 | { 14 | puts ("hcreate failed"); 15 | return 1; 16 | } 17 | 18 | i.key = (char *) "one"; 19 | i.data = &a; 20 | if (hsearch (i, ENTER) == NULL) 21 | return 1; 22 | 23 | i.key = (char *) "one"; 24 | i.data = &b; 25 | e = hsearch (i, ENTER); 26 | printf ("e.data = %d\n", *(int *) e->data); 27 | if (*(int *) e->data != 1) 28 | return 1; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/stdio-common/bug6.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int 4 | main (void) 5 | { 6 | char buf[80]; 7 | int i; 8 | int lost = 0; 9 | 10 | scanf ("%2s", buf); 11 | lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0'); 12 | if (lost) 13 | puts ("test of %2s failed."); 14 | scanf (" "); 15 | scanf ("%d", &i); 16 | lost |= (i != 1234); 17 | if (lost) 18 | puts ("test of %d failed."); 19 | scanf ("%c", buf); 20 | lost |= (buf[0] != 'L'); 21 | if (lost) 22 | puts ("test of %c failed.\n"); 23 | 24 | puts (lost ? "Test FAILED!" : "Test succeeded."); 25 | return lost; 26 | } 27 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/08.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EACCES when O_CREAT is specified, the file does not exist, and the directory in which it is to be created does not permit writing" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | quick_exit #zrtfs not support uid,gid 10 | echo "1..3" 11 | 12 | n0=`namegen` 13 | n1=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY,O_CREAT 0644 19 | cd ${cdir} 20 | expect 0 rmdir ${n0} 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/17.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/17.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns EFAULT if one of the pathnames specified is outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | expect EFAULT link ${n0} NULL 15 | expect EFAULT link ${n0} DEADCODE 16 | expect 0 unlink ${n0} 17 | expect EFAULT link NULL ${n0} 18 | expect EFAULT link DEADCODE ${n0} 19 | expect EFAULT link NULL DEADCODE 20 | expect EFAULT link DEADCODE NULL 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/01.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ENAMETOOLONG if a component of either pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${name255} 0644 14 | expect 0 rename ${name255} ${n0} 15 | expect 0 rename ${n0} ${name255} 16 | expect 0 unlink ${name255} 17 | 18 | expect 0 create ${n0} 0644 19 | expect ENAMETOOLONG rename ${n0} ${name256} 20 | expect 0 unlink ${n0} 21 | expect ENAMETOOLONG rename ${name256} ${n0} 22 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/17.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/17.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EFAULT if one of the pathnames specified is outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | expect EFAULT rename ${n0} NULL 15 | expect EFAULT rename ${n0} DEADCODE 16 | expect 0 unlink ${n0} 17 | expect EFAULT rename NULL ${n0} 18 | expect EFAULT rename DEADCODE ${n0} 19 | expect EFAULT rename NULL DEADCODE 20 | expect EFAULT rename DEADCODE NULL 21 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-fgets.c: -------------------------------------------------------------------------------- 1 | /* Derived from the test case in 2 | http://sourceware.org/bugzilla/show_bug.cgi?id=713. */ 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | FILE *fp = fmemopen ((char *) "hello", 5, "r"); 9 | char buf[2]; 10 | char *bp = fgets (buf, sizeof (buf), fp); 11 | printf ("fgets: %s\n", bp == buf ? "OK" : "ERROR"); 12 | int res = bp != buf; 13 | bp = fgets_unlocked (buf, sizeof (buf), fp); 14 | printf ("fgets_unlocked: %s\n", bp == buf ? "OK" : "ERROR"); 15 | res |= bp != buf; 16 | return res; 17 | } 18 | 19 | #define TEST_FUNCTION do_test () 20 | #include "../test-skeleton.c" 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/05.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/05.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" = "zrtfs" ] #zrtfs does not supported symlinks 10 | then 11 | quick_exit 12 | fi 13 | echo "1..6" 14 | 15 | n0=`namegen` 16 | n1=`namegen` 17 | 18 | expect 0 symlink ${n0} ${n1} 19 | expect 0 symlink ${n1} ${n0} 20 | expect ELOOP rmdir ${n0}/test 21 | expect ELOOP rmdir ${n1}/test 22 | expect 0 unlink ${n0} 23 | expect 0 unlink ${n1} 24 | -------------------------------------------------------------------------------- /libports/lua-5.2.1/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.7 2009/11/27 15:37:59 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/01.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns ENOTDIR if a component of either path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect 0 create ${n0}/${n1} 0644 17 | expect ENOTDIR link ${n0}/${n1}/test ${n0}/${n2} 18 | expect 0 create ${n0}/${n2} 0644 19 | expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test 20 | expect 0 unlink ${n0}/${n1} 21 | expect 0 unlink ${n0}/${n2} 22 | expect 0 rmdir ${n0} 23 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/bug-ga1.c: -------------------------------------------------------------------------------- 1 | /* Test case by Anders Carlsson . */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (void) 10 | { 11 | struct addrinfo req, *ai; 12 | char name[] = "3ffe:0200:0064:0000:0202:b3ff:fe16:ddc5"; 13 | 14 | memset (&req, '\0', sizeof req); 15 | req.ai_family = AF_INET6; 16 | 17 | /* This call used to crash. We cannot expect the test machine to have 18 | IPv6 enabled so we just check that the call returns. */ 19 | getaddrinfo (name, NULL, &req, &ai); 20 | 21 | puts ("success!"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/stdio-common/bug22.c: -------------------------------------------------------------------------------- 1 | /* BZ #5424 */ 2 | #include 3 | 4 | #define N 2147483648 5 | 6 | #define STRINGIFY(S) #S 7 | #define MAKE_STR(S) STRINGIFY(S) 8 | 9 | #define SN MAKE_STR(N) 10 | 11 | static int 12 | do_test (void) 13 | { 14 | int ret; 15 | 16 | FILE *fp = fopen ("/dev/null", "w"); 17 | if (fp == NULL) 18 | { 19 | puts ("cannot open /dev/null"); 20 | return 1; 21 | } 22 | 23 | ret = fprintf (fp, "%" SN "d%" SN "d", 1, 1); 24 | 25 | printf ("ret = %d\n", ret); 26 | 27 | return ret != -1; 28 | } 29 | 30 | #define TIMEOUT 30 31 | #define TEST_FUNCTION do_test () 32 | #include "../test-skeleton.c" 33 | -------------------------------------------------------------------------------- /tests/zrt_test_suite/nvram_tests.template: -------------------------------------------------------------------------------- 1 | ########################################################### 2 | # ZRT nvram file, setup cmd line args, environment vars # 3 | ########################################################### 4 | 5 | [env] 6 | {ENVIRONMENT} 7 | name=usable, value=1\x2C2\x2C3/"1\x2C2\x2C3" 8 | 9 | [args] 10 | {COMMAND_LINE} 11 | 12 | [mapping] 13 | {MAPPING} 14 | 15 | [fstab] 16 | {FSTAB} 17 | channel=/dev/mount/gcov.gcda.tar, mountpoint=/, access=ro, removable=no 18 | channel=/dev/mount/gcov.gcda.tar, mountpoint=/home/zvm/git/zrt, access=wo, removable=no 19 | 20 | [time] 21 | {SECONDS} 22 | 23 | [debug] 24 | verbosity=2 25 | 26 | [precache] 27 | {PRECACHE} -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/bug-strncat1.c: -------------------------------------------------------------------------------- 1 | /* Test case by Joseph S. Myers . */ 2 | #undef __USE_STRING_INLINES 3 | #define __USE_STRING_INLINES 4 | #include 5 | #include 6 | #include 7 | 8 | char d[3] = "\0\1\2"; 9 | 10 | int 11 | main (int argc, char**argv) 12 | { 13 | strncat (d, "\5\6", 1); 14 | if (d[0] != '\5') 15 | { 16 | puts ("d[0] != '\\5'"); 17 | exit (1); 18 | } 19 | if (d[1] != '\0') 20 | { 21 | puts ("d[1] != '\\0'"); 22 | exit (1); 23 | } 24 | if (d[2] != '\2') 25 | { 26 | puts ("d[2] != '\\2'"); 27 | exit (1); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/06.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" = "zrtfs" ] #zrtfs does not support symlinks 10 | then 11 | quick_exit 12 | fi 13 | 14 | echo "1..6" 15 | 16 | n0=`namegen` 17 | n1=`namegen` 18 | 19 | expect 0 symlink ${n0} ${n1} 20 | expect 0 symlink ${n1} ${n0} 21 | expect ELOOP chmod ${n0}/test 0644 22 | expect ELOOP chmod ${n1}/test 0644 23 | expect 0 unlink ${n0} 24 | expect 0 unlink ${n1} 25 | 26 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/12.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ENOTDIR if a component of either path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect 0 create ${n0}/${n1} 0644 17 | expect ENOTDIR rename ${n0}/${n1}/test ${n0}/${n2} 18 | expect 0 create ${n0}/${n2} 0644 19 | expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test 20 | expect 0 unlink ${n0}/${n1} 21 | expect 0 unlink ${n0}/${n2} 22 | expect 0 rmdir ${n0} 23 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/08.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns EPERM if the named file is a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 mkdir ${n0} 0755 14 | case "${os}:${fs}" in 15 | SunOS:UFS) 16 | expect 0 unlink ${n0} 17 | expect ENOENT rmdir ${n0} 18 | ;; 19 | Linux:*) 20 | # Non-POSIX value returned by Linux since 2.1.132 21 | expect EISDIR unlink ${n0} 22 | expect 0 rmdir ${n0} 23 | ;; 24 | *) 25 | expect EPERM unlink ${n0} 26 | expect 0 rmdir ${n0} 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/kill_fstest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FIFO_FOR_INPUT=data/fstest.fifo.input 4 | 5 | #Close background fstest.nexe process or kill it if did not respond 6 | 7 | if [ "`pgrep -f fstest.manifest`" != "" ] 8 | then 9 | echo "kill fstest.nexe instance" 10 | #send controldata to kill fstest 11 | echo test12345complete > $FIFO_FOR_INPUT 12 | sleep 1 13 | if [ "`pgrep -f fstest.manifest`" != "" ] 14 | then 15 | echo fstest does not closed correctly - killed 16 | pgrep -f fstest.manifest | xargs kill -9 17 | fi 18 | fi 19 | 20 | if [ "`pgrep -f redirect_pipe`" != "" ] 21 | then 22 | pgrep -f redirect_pipe | xargs kill -9 23 | fi -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/02.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | expect 0 open ${name255} O_CREAT 0620 12 | expect 0620 stat ${name255} mode 13 | expect 0 unlink ${name255} 14 | if [ "${fs}" != "zrtfs" ] 15 | then 16 | expect ENAMETOOLONG open ${name256} O_CREAT 0620 17 | else 18 | #zrtfs returning errno=ENAMETOOLONG overwriten in further to EPERM in unexpected way 19 | expect EPERM open ${name256} O_CREAT 0620 20 | fi 21 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/13.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EBUSY if the directory to be removed is the mount point for a mounted file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..3" 12 | 13 | n0=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | n=`mdconfig -a -n -t malloc -s 1m` 17 | newfs /dev/md${n} >/dev/null 18 | mount /dev/md${n} ${n0} 19 | expect EBUSY rmdir ${n0} 20 | umount /dev/md${n} 21 | mdconfig -d -u ${n} 22 | expect 0 rmdir ${n0} 23 | ;; 24 | *) 25 | quick_exit 26 | ;; 27 | esac 28 | -------------------------------------------------------------------------------- /libports/context-switch/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | ARCH=x86_64-nacl 3 | # ARCH=x86_64-linux-gnu 4 | 5 | CFLAGS=-Wno-long-long -msse4.1 -m64 -g 6 | 7 | 8 | LDFLAGS= 9 | CFLAGS+= 10 | 11 | NAME=libcontext 12 | OBJECTS=$(patsubst %.S,%.o,$(wildcard src/*.S)) 13 | OBJECTS+=$(patsubst %.c,%.o,$(wildcard src/*.c)) 14 | TESTS=$(patsubst tests/%.c,%,$(wildcard tests/tst-*.c)) 15 | 16 | all: ${NAME}.a #${TESTS} 17 | # @./test.sh 18 | 19 | ${NAME}.a: ${OBJECTS} 20 | $(AR) rcs ${NAME}.a ${OBJECTS} 21 | 22 | ${TESTS}: %: tests/%.o 23 | $(CC) -o $@ $< -lcontext -L. 24 | 25 | clean: 26 | @rm ${NAME}.a tst* src/*.o tests/*.o *.conf std* *.log *.manifest >/dev/null 2>&1 || true 27 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/06.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns EACCES if the named file is not writable by the user" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..8" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | cdir=`pwd` 16 | cd ${n0} 17 | expect 0 create ${n1} 0644 18 | expect EACCES -u 65534 -g 65534 truncate ${n1} 123 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 chmod ${n1} 0444 21 | expect EACCES -u 65534 -g 65534 truncate ${n1} 123 22 | expect 0 unlink ${n1} 23 | cd ${cdir} 24 | expect 0 rmdir ${n0} 25 | -------------------------------------------------------------------------------- /gdb_commands.template: -------------------------------------------------------------------------------- 1 | define pint 2 | printf "%d", *((uint64_t)0x440a00000000+(uint64_t)&$arg0) 3 | end 4 | define phex 5 | printf "0x%X", *((uint64_t)0x440a00000000+(uint64_t)&$arg0) 6 | end 7 | define ppointer 8 | printf "0x%X", (uint64_t)0x440a00000000+(uint64_t)$arg0 9 | end 10 | define pstr 11 | printf "%s", (uint64_t)0x440a00000000+(uint64_t)$arg0 12 | end 13 | define pstruct 14 | p ($arg1)*((uint64_t)0x440a00000000+(uint64_t)&$arg0) 15 | end 16 | define pstructp 17 | p ($arg1)*((uint64_t)0x440a00000000+(uint64_t)$arg0) 18 | end 19 | set confirm off 20 | set output-radix 16 21 | b CreateSession 22 | r 23 | add-symbol-file {NEXE_FULL_PATH} 0x440a00020000 24 | b main 25 | b abort 26 | c 27 | 28 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/string/bug-strcoll1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char** argv) 7 | { 8 | const char t1[] = "0-0-0-0-0-0-0-0-0-0.COM"; 9 | const char t2[] = "00000-00000.COM"; 10 | int res1; 11 | int res2; 12 | 13 | setlocale (LC_ALL, "en_US.ISO-8859-1"); 14 | 15 | res1 = strcoll (t1, t2); 16 | printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, res1); 17 | res2 = strcoll (t2, t1); 18 | printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, res2); 19 | 20 | return ((res1 == 0 && res2 != 0) 21 | || (res1 != 0 && res2 == 0) 22 | || (res1 < 0 && res2 < 0) 23 | || (res1 > 0 && res2 > 0)); 24 | } 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/02.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns ENAMETOOLONG if a component of either pathname exceeded 255 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${name255} 0644 14 | expect 0 link ${name255} ${n0} 15 | expect 0 unlink ${name255} 16 | expect 0 link ${n0} ${name255} 17 | expect 0 unlink ${n0} 18 | expect 0 unlink ${name255} 19 | 20 | expect 0 create ${n0} 0644 21 | expect ENAMETOOLONG link ${n0} ${name256} 22 | expect 0 unlink ${n0} 23 | expect ENAMETOOLONG link ${name256} ${n0} 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/20.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/20.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ETXTBSY when the file is a pure procedure (shared text) file that is being executed and the open() system call requests write access" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..4" 12 | 13 | n0=`namegen` 14 | 15 | cp -pf `which sleep` ${n0} 16 | ./${n0} 3 & 17 | expect ETXTBSY open ${n0} O_WRONLY 18 | expect ETXTBSY open ${n0} O_RDWR 19 | expect ETXTBSY open ${n0} O_RDONLY,O_TRUNC 20 | expect 0 unlink ${n0} 21 | ;; 22 | *) 23 | quick_exit 24 | ;; 25 | esac 26 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/21.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/21.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EFAULT if the path argument points outside the process's allocated address space" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..2" 12 | else 13 | echo "1..1" 14 | fi 15 | 16 | if [ "${fs}" != "zrtfs" ] 17 | then 18 | expect EFAULT open NULL O_RDONLY 19 | expect EFAULT open DEADCODE O_RDONLY 20 | else 21 | #zrtfs returning errno=EFAULT overwriten in further to EPERM in unexpected way 22 | expect EPERM open NULL O_RDONLY 23 | fi 24 | 25 | -------------------------------------------------------------------------------- /lib/networking/README: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------- 3 | Networking Library 4 | -------------------------------------------- 5 | {DOCPATH} 6 | 7 | 1. Networking Library allows to setup network channels using channels 8 | configuration from manifest file and it's based on channel alias names 9 | accessible runtime via readir function; Using of networking library 10 | allows to setup networking channels set just use dynamical channel 11 | aliases from configuration, that way eliminates most of hardcoded 12 | data; 13 | 2. Object files belongs to this library are resides on 14 | libnetworking.a, so use: LDFLAGS+=-lnetworking 15 | 3. Examples of usage by samples: disort, reqrep, wordcount 16 | -------------------------------------------------------------------------------- /libports/pth-2.0.7/README.zerovm: -------------------------------------------------------------------------------- 1 | ./configure --host=x86_64-nacl prefix=$ZVM_PREFIX/x86_64-nacl \ 2 | --enable-pthread --enable-shared=no --enable-tests=no --enable-optimize=no \ 3 | --with-mctx-mth=mcsc \ 4 | --with-mctx-dsp=sc \ 5 | --with-mctx-stk=mc 6 | 7 | make all 8 | make install 9 | 10 | pthread.h will be installed into x86_64-nacl/include/pth/, so 11 | explicit include path is required in your sources, for example: 12 | #include 13 | 14 | note: as pth was added into libports and it's installing at the same 15 | time as zrt on a clean zvm_prefix it shouldn't run configure while zrt 16 | not yet installed, because test executables trying to create during 17 | configure can't be linked -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/13.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EISDIR when he named file is a directory, and the arguments specify it is to be modified" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..8" 12 | 13 | n0=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | 17 | expect 0 open ${n0} O_RDONLY 18 | expect EISDIR open ${n0} O_WRONLY 19 | expect EISDIR open ${n0} O_RDWR 20 | expect EISDIR open ${n0} O_RDONLY,O_TRUNC 21 | expect EISDIR open ${n0} O_WRONLY,O_TRUNC 22 | expect EISDIR open ${n0} O_RDWR,O_TRUNC 23 | 24 | expect 0 rmdir ${n0} 25 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/setjmp/jmpbug.c: -------------------------------------------------------------------------------- 1 | /* setjmp vs alloca test case. Exercised bug on sparc. */ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | static void 8 | sub5 (jmp_buf buf) 9 | { 10 | longjmp (buf, 1); 11 | } 12 | 13 | static void 14 | test (int x) 15 | { 16 | jmp_buf buf; 17 | char *foo; 18 | int arr[100]; 19 | 20 | arr[77] = x; 21 | if (setjmp (buf)) 22 | { 23 | printf ("made it ok; %d\n", arr[77]); 24 | return; 25 | } 26 | 27 | foo = (char *) alloca (128); 28 | sub5 (buf); 29 | } 30 | 31 | int 32 | main (void) 33 | { 34 | int i; 35 | 36 | for (i = 123; i < 345; ++i) 37 | test (i); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/09.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/09.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns EEXIST if the named file exists" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 mkdir ${n0} 0755 14 | expect EEXIST mkfifo ${n0} 0644 15 | expect 0 rmdir ${n0} 16 | 17 | expect 0 create ${n0} 0644 18 | expect EEXIST mkfifo ${n0} 0644 19 | expect 0 unlink ${n0} 20 | 21 | expect 0 symlink test ${n0} 22 | expect EEXIST mkfifo ${n0} 0644 23 | expect 0 unlink ${n0} 24 | 25 | expect 0 mkfifo ${n0} 0644 26 | expect EEXIST mkfifo ${n0} 0644 27 | expect 0 unlink ${n0} 28 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/12.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns EFBIG or EINVAL if the length argument was greater than the maximum file size" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..3" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | r=`${fstest} truncate ${n0} 999999999999999 2>/dev/null` 15 | case "${r}" in 16 | EFBIG|EINVAL) 17 | expect 0 stat ${n0} size 18 | ;; 19 | 0) 20 | expect 999999999999999 stat ${n0} size 21 | ;; 22 | *) 23 | echo "not ok ${ntest}" 24 | ntest=`expr ${ntest} + 1` 25 | ;; 26 | esac 27 | expect 0 unlink ${n0} 28 | -------------------------------------------------------------------------------- /libports/sqlite3/README: -------------------------------------------------------------------------------- 1 | ------------------------------------------------ 2 | 1.Sqlite3 dbms static library. Ported to ZRT. 3 | source: www.sqlite.org 4 | ------------------------------------------------ 5 | 6 | 1.1.Since ZeroVM has no own filesystem, in any case we are need to provide access to database file; 7 | For this case used virtual file system (VFS) API as part of sqlite, and our implementation that currently 8 | support read only database access without journaling; 9 | Sqlite compiled with nacl-gcc doesn't support getpid and ftruncate, that will always fails; 10 | 1.2.In order to linking it add folowing flags: -L{YOUR_ZRT_ROOT}/lib -lsqlite3 11 | 12 | TODO: Add ZFS to get sqlite working with real filesystem. -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int arc, char *argv[]) 6 | { 7 | int res; 8 | unsigned int val; 9 | 10 | FILE *fp = fopen ("/dev/null", "r"); 11 | 12 | val = 0; 13 | res = fscanf(fp, "%n", &val); 14 | 15 | printf("Result of fscanf %%n = %d\n", res); 16 | printf("Scanned format = %d\n", val); 17 | 18 | res = fscanf(fp, ""); 19 | printf("Result of fscanf \"\" = %d\n", res); 20 | if (res != 0) 21 | abort (); 22 | 23 | res = fscanf(fp, "BLURB"); 24 | printf("Result of fscanf \"BLURB\" = %d\n", res); 25 | if (res >= 0) 26 | abort (); 27 | 28 | fclose (fp); 29 | 30 | return 0; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /libports/pth-2.0.7/AUTHORS: -------------------------------------------------------------------------------- 1 | ____ _ _ 2 | | _ \| |_| |__ 3 | | |_) | __| '_ \ ``Some people have entirely too 4 | | __/| |_| | | | much free time on their hands.'' 5 | |_| \__|_| |_| -- Gene Spafford 6 | 7 | GNU Pth - The GNU Portable Threads 8 | 9 | AUTHORS 10 | ======= 11 | 12 | This is a list of authors who have written 13 | or edited major parts of the GNU Pth sources. 14 | 15 | o GNU Pth (as a whole): 16 | Written by: Ralf S. Engelschall 17 | Edited by: Ralf S. Engelschall 18 | 19 | o pthread.pod: 20 | Written by: Ralf S. Engelschall 21 | Parts from: The Open Group 22 | Edited by: Ralf S. Engelschall 23 | 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/23.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/23.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EINVAL when an attempt was made to open a descriptor with an illegal combination of O_RDONLY, O_WRONLY, and O_RDWR" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 create ${n0} 0644 14 | case "${os}" in 15 | Linux) 16 | expect 0 open ${n0} O_WRONLY,O_RDWR 17 | expect 0 open ${n0} O_RDONLY,O_WRONLY,O_RDWR 18 | ;; 19 | *) 20 | expect EINVAL open ${n0} O_WRONLY,O_RDWR 21 | expect EINVAL open ${n0} O_RDONLY,O_WRONLY,O_RDWR 22 | ;; 23 | esac 24 | expect 0 unlink ${n0} 25 | -------------------------------------------------------------------------------- /libports/context-switch/tests/tst-makecontext2-input.txt: -------------------------------------------------------------------------------- 1 | __int128: 18 0x24f350 16 2 | double: 12 0x24f348 8 3 | ldouble: 15 0x24f340 8 4 | __int128: 18 0x24f350 16 5 | double: 12 0x24f348 8 6 | ldouble: 15 0x24f340 8 7 | __int128: 18 0x24f350 16 8 | double: 12 0x24f348 8 9 | ldouble: 15 0x24f340 8 10 | __int128: 18 0x24f350 16 11 | double: 12 0x24f348 8 12 | ldouble: 15 0x24f340 8 13 | __int128: 18 0x24f340 16 14 | double: 12 0x24f338 8 15 | ldouble: 15 0x24f330 8 16 | __int128: 18 0x24f340 16 17 | double: 12 0x24f338 8 18 | ldouble: 15 0x24f330 8 19 | __int128: 18 0x24f340 16 20 | double: 12 0x24f338 8 21 | ldouble: 15 0x24f330 8 22 | __int128: 18 0x24f340 16 23 | double: 12 0x24f338 8 24 | ldouble: 15 0x24f330 8 25 | -------------------------------------------------------------------------------- /tests/lua_test_suite/lua-5.2.1-tests/libs/makefile: -------------------------------------------------------------------------------- 1 | # change this variable to point to the directory with Lua headers 2 | # of the version being tested 3 | LUA_DIR = ../.. 4 | 5 | CC = gcc 6 | 7 | # compilation should generate Dynamic-Link Libraries 8 | CFLAGS = -Wall -O2 -I$(LUA_DIR) -ansi -fpic -shared 9 | 10 | # libraries used by the tests 11 | all: lib1.so lib11.so lib2.so lib21.so v-lib2.so 12 | 13 | lib1.so: lib1.c 14 | $(CC) $(CFLAGS) -o lib1.so lib1.c 15 | 16 | lib11.so: lib11.c 17 | $(CC) $(CFLAGS) -o lib11.so lib11.c 18 | 19 | lib2.so: lib2.c 20 | $(CC) $(CFLAGS) -o lib2.so lib2.c 21 | 22 | lib21.so: lib21.c 23 | $(CC) $(CFLAGS) -o lib21.so lib21.c 24 | 25 | v-lib2.so: lib2.so 26 | mv lib2.so ./v-lib2.so 27 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug14.c: -------------------------------------------------------------------------------- 1 | /* Test case by Al Viro . */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* MB_CUR_MAX multibyte ones (6 UTF+0080, in this case) */ 8 | static const char string[] = "\ 9 | \xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80\xc2\x80"; 10 | 11 | int 12 | main (void) 13 | { 14 | if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) 15 | { 16 | puts ("cannot set locale"); 17 | exit (1); 18 | } 19 | 20 | wchar_t s[7]; 21 | int n = sscanf (string, "%l[\x80\xc2]", s); 22 | if (n != 1) 23 | { 24 | printf ("return values %d != 1\n", n); 25 | exit (1); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/08.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns ELOOP if too many symbolic links were encountered in translating one of the pathnames" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 symlink ${n0} ${n1} 16 | expect 0 symlink ${n1} ${n0} 17 | expect ELOOP link ${n0}/test ${n2} 18 | expect ELOOP link ${n1}/test ${n2} 19 | expect 0 create ${n2} 0644 20 | expect ELOOP link ${n2} ${n0}/test 21 | expect ELOOP link ${n2} ${n1}/test 22 | expect 0 unlink ${n0} 23 | expect 0 unlink ${n1} 24 | expect 0 unlink ${n2} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/12.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EINVAL if the last component of the path is '.' or '..'" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 mkdir ${n0}/${n1} 0755 16 | expect EINVAL rmdir ${n0}/${n1}/. 17 | case "${os}" in 18 | FreeBSD) 19 | expect EINVAL rmdir ${n0}/${n1}/.. 20 | ;; 21 | Linux) 22 | expect 'ENOTEMPTY|EEXIST' rmdir ${n0}/${n1}/.. 23 | ;; 24 | *) 25 | expect EEXIST rmdir ${n0}/${n1}/.. 26 | ;; 27 | esac 28 | expect 0 rmdir ${n0}/${n1} 29 | expect 0 rmdir ${n0} 30 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf9.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | int matches; 9 | char str[10]; 10 | 11 | str[0] = '\0'; 12 | matches = -9; 13 | matches = sscanf ("x ]", "%[^] ]", str); 14 | printf ("Matches = %d, string str = \"%s\".\n", matches, str); 15 | printf ("str should be \"x\".\n"); 16 | 17 | if (strcmp (str, "x")) 18 | abort (); 19 | 20 | str[0] = '\0'; 21 | matches = -9; 22 | matches = sscanf (" ] x", "%[] ]", str); 23 | printf ("Matches = %d, string str = \"%s\".\n", matches, str); 24 | printf ("str should be \" ] \".\n"); 25 | 26 | if (strcmp (str, " ] ")) 27 | abort (); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/01.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ENOTDIR if a component of the path prefix is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..5" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect 0 create ${n0}/${n1} 0644 16 | if [ "${fs}" != "zrtfs" ] 17 | then 18 | expect ENOTDIR open ${n0}/${n1}/test O_CREAT 0644 19 | else 20 | #zrtfs returning errno=ENOTDIR overwriten in further to EPERM in unexpected way 21 | expect EPERM open ${n0}/${n1}/test O_CREAT 0644 22 | fi 23 | expect 0 unlink ${n0}/${n1} 24 | expect 0 rmdir ${n0} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/11.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ELOOP if too many symbolic links were encountered in translating one of the pathnames" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 symlink ${n0} ${n1} 16 | expect 0 symlink ${n1} ${n0} 17 | expect ELOOP rename ${n0}/test ${n2} 18 | expect ELOOP rename ${n1}/test ${n2} 19 | expect 0 create ${n2} 0644 20 | expect ELOOP rename ${n2} ${n0}/test 21 | expect ELOOP rename ${n2} ${n1}/test 22 | expect 0 unlink ${n0} 23 | expect 0 unlink ${n1} 24 | expect 0 unlink ${n2} 25 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (void) 7 | { 8 | char *bp; 9 | size_t size; 10 | FILE *stream; 11 | int lose = 0; 12 | 13 | stream = open_memstream (&bp, &size); 14 | fprintf (stream, "hello"); 15 | fflush (stream); 16 | printf ("buf = %s, size = %Zu\n", bp, size); 17 | lose |= size != 5; 18 | lose |= strncmp (bp, "hello", size); 19 | fprintf (stream, ", world"); 20 | fclose (stream); 21 | printf ("buf = %s, size = %Zu\n", bp, size); 22 | lose |= size != 12; 23 | lose |= strncmp (bp, "hello, world", 12); 24 | 25 | puts (lose ? "Test FAILED!" : "Test succeeded."); 26 | 27 | free (bp); 28 | 29 | return lose; 30 | } 31 | -------------------------------------------------------------------------------- /locale/README: -------------------------------------------------------------------------------- 1 | Since localisation support it is an experimental feature that may not 2 | work. You can try to create localisation here are using same method to 3 | generate localisation files. Here is a file 'locales', in current 4 | folder. Which hold a list of experimental locales. 5 | > make 6 | Just run make, and it's create quiet process of building patcher, 7 | creation of localisation for system environment, and applying patch to 8 | it, to be compatible with glibc locale file version. 9 | TODO: Instead of patch, skeep locale version check inside of glibc. 10 | 11 | Under construction... 12 | Get localisation files by building locale sources [in progress] 13 | ~/git/zrt/tools/locale_compiled/localedef/mounts/locales_i18n.tar 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug13.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | 5 | int 6 | main (void) 7 | { 8 | int res = 0; 9 | char buf[100]; 10 | 11 | #define TEST(nr, result, format, args...) \ 12 | if (sprintf (buf, format, ## args) != result) \ 13 | { \ 14 | printf ("test %d failed (\"%s\", %d)\n", nr, buf, result); \ 15 | res = 1; \ 16 | } 17 | 18 | TEST (1, 2, "%d", -1); 19 | TEST (2, 2, "% 2d", 1); 20 | TEST (3, 3, "%#x", 1); 21 | TEST (4, 2, "%+d", 1); 22 | TEST (5, 2, "% d", 1); 23 | TEST (6, 2, "%-d", -1); 24 | TEST (7, 2, "%- 2d", 1); 25 | TEST (8, 3, "%-#x", 1); 26 | TEST (9, 2, "%-+d", 1); 27 | TEST (10, 2, "%- d", 1); 28 | 29 | return res; 30 | } 31 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/00.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/00.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir removes directories" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | expect dir lstat ${n0} type 16 | expect 0 rmdir ${n0} 17 | expect ENOENT lstat ${n0} type 18 | 19 | expect 0 mkdir ${n0} 0755 20 | expect 0 mkdir ${n0}/${n1} 0755 21 | time=`${fstest} stat ${n0} ctime` 22 | sleep 1 23 | expect 0 rmdir ${n0}/${n1} 24 | mtime=`${fstest} stat ${n0} mtime` 25 | test_check $time -lt $mtime 26 | ctime=`${fstest} stat ${n0} ctime` 27 | test_check $time -lt $ctime 28 | expect 0 rmdir ${n0} 29 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int argc, char *argv[]) 6 | { 7 | int point, x, y; 8 | 9 | point = x = y = -1; 10 | sscanf("0x10 10", "%x %x", &x, &y); 11 | printf("%d %d\n", x, y); 12 | if (x != 0x10 || y != 0x10) 13 | abort (); 14 | point = x = y = -1; 15 | sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y); 16 | printf("%d %d %d\n", point, x, y); 17 | if (point != 0 || x != 1234 || y != 9876) 18 | abort (); 19 | point = x = y = -1; 20 | sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y); 21 | printf("%d %d %d\n", point, x, y); 22 | if (point != 1 || x != 1234 || y != 9876) 23 | abort (); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/elf/tst-global1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main (void) 6 | { 7 | void *h1 = dlopen ("$ORIGIN/testobj6.so", RTLD_GLOBAL|RTLD_LAZY); 8 | if (h1 == NULL) 9 | { 10 | puts ("cannot open testobj6"); 11 | return 1; 12 | } 13 | 14 | void *h2 = dlopen ("$ORIGIN/testobj2.so", 15 | RTLD_GLOBAL|RTLD_DEEPBIND|RTLD_LAZY); 16 | if (h2 == NULL) 17 | { 18 | puts ("cannot open testobj2"); 19 | return 1; 20 | } 21 | 22 | dlclose (h1); 23 | 24 | void (*f) (void) = dlsym (h2, "p"); 25 | if (f == NULL) 26 | { 27 | puts ("cannot find p"); 28 | return 1; 29 | } 30 | 31 | f (); 32 | 33 | dlclose (h2); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/libio/tst_wscanf.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main (int argc, char *argv[]) 7 | { 8 | int n; 9 | int result = 0; 10 | char buf1[20]; 11 | wchar_t wbuf2[20]; 12 | char c3; 13 | wchar_t wc4; 14 | int d; 15 | 16 | puts ("Test 1"); 17 | 18 | n = wscanf (L"%s %S %c%C %d", buf1, wbuf2, &c3, &wc4, &d); 19 | 20 | if (n != 5 || strcmp (buf1, "Hello") != 0 || wcscmp (wbuf2, L"World") != 0 21 | || c3 != '!' || wc4 != L'!' || d != 42) 22 | { 23 | printf ("*** FAILED, n = %d, buf1 = \"%s\", wbuf2 = L\"%S\", c3 = '%c', wc4 = L'%C', d = %d\n", 24 | n, buf1, wbuf2, c3, (wint_t) wc4, d); 25 | result = 1; 26 | } 27 | 28 | return result; 29 | } 30 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/19.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/19.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EINVAL when an attempt is made to rename '.' or '..'" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..6" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect 0 mkdir ${n0}/${n1} 0755 17 | 18 | case "${os}" in 19 | Linux) 20 | expect EBUSY rename ${n0}/${n1}/. ${n2} 21 | expect EBUSY rename ${n0}/${n1}/.. ${n2} 22 | ;; 23 | *) 24 | expect EINVAL rename ${n0}/${n1}/. ${n2} 25 | expect EINVAL rename ${n0}/${n1}/.. ${n2} 26 | ;; 27 | esac 28 | 29 | expect 0 rmdir ${n0}/${n1} 30 | expect 0 rmdir ${n0} 31 | -------------------------------------------------------------------------------- /libports/lua-5.2.1/README: -------------------------------------------------------------------------------- 1 | --------------------------------------------- 2 | Lua static library. This is Lua 5.2.1, released on 08 Jun 2012. Ported to ZRT. 3 | source: www.lua.org 4 | --------------------------------------------- 5 | 6 | 1. Static Library using Lua 5.2.1 distribution files AS IS. Files related to lua compiler and interpretator 7 | not a part of library and was moved into folder lua-5.2.1/src/not_for_lib; 8 | 2. In order link it add the folowing flags: -L{YOUR_ZRT_ROOT}/lib -lzrt -llua; 9 | 3. Lua test suite is using this library, to pass Lua tests; 10 | 4. Easy run of lua scripts is provided by zshell executable, can be found here /zrt/samples/zshell; 11 | 5. Here is some limitations related to zrt library and ZeroVM for files I/O. see /zrt/lib/README 12 | 13 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/misc/tst-error1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | static int 8 | do_test (int argc, char *argv[]) 9 | { 10 | mtrace (); 11 | (void) freopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr); 12 | /* Orient the stream. */ 13 | fwprintf (stderr, L"hello world\n"); 14 | char buf[20000]; 15 | static const char str[] = "hello world! "; 16 | for (int i = 0; i < 1000; ++i) 17 | memcpy (&buf[i * (sizeof (str) - 1)], str, sizeof (str)); 18 | error (0, 0, str); 19 | error (0, 0, buf); 20 | error (0, 0, buf); 21 | error (0, 0, str); 22 | return 0; 23 | } 24 | 25 | #define TEST_FUNCTION do_test (argc, argv) 26 | #include "../test-skeleton.c" 27 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/bug-regex15.c: -------------------------------------------------------------------------------- 1 | /* Test for memory/CPU leak in regcomp. */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define TEST_DATA_LIMIT (32 << 20) 10 | 11 | static int do_test (void); 12 | #define TEST_FUNCTION do_test () 13 | #include "../test-skeleton.c" 14 | 15 | static int 16 | do_test (void) 17 | { 18 | regex_t re; 19 | int reerr; 20 | 21 | reerr = regcomp (&re, "^6?3?[25]?5?[14]*[25]*[69]*+[58]*87?4?$", 22 | REG_EXTENDED | REG_NOSUB); 23 | if (reerr != 0) 24 | { 25 | char buf[100]; 26 | regerror (reerr, &re, buf, sizeof buf); 27 | printf ("regerror %s\n", buf); 28 | return 1; 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/07.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ELOOP if too many symbolic links were encountered in translating the pathname" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "$fs" != "zrtfs" ] 10 | then 11 | echo "1..6" 12 | else 13 | quick_exit 14 | fi 15 | 16 | n0=`namegen` 17 | n1=`namegen` 18 | 19 | if [ "$fs" != "zrtfs" ] #symlink does not supported by zrtfs; excluded all 6 tests 20 | then 21 | expect 0 symlink ${n0} ${n1} 22 | expect 0 symlink ${n1} ${n0} 23 | expect ELOOP mkdir ${n0}/test 0755 24 | expect ELOOP mkdir ${n1}/test 0755 25 | expect 0 unlink ${n0} 26 | expect 0 unlink ${n1} 27 | fi 28 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/time/bug-asctime_r.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | static int 8 | do_test (void) 9 | { 10 | int result = 0; 11 | time_t t = time (NULL); 12 | struct tm *tp = localtime (&t); 13 | tp->tm_year = 10000 - 1900; 14 | char buf[1000]; 15 | errno = 0; 16 | buf[26] = '\xff'; 17 | char *s = asctime_r (tp, buf); 18 | if (s != NULL || errno != EOVERFLOW) 19 | { 20 | puts ("asctime_r did not fail correctly"); 21 | result = 1; 22 | } 23 | if (buf[26] != '\xff') 24 | { 25 | puts ("asctime_r overwrote 27th byte in buffer"); 26 | result = 1; 27 | } 28 | return result; 29 | } 30 | 31 | #define TEST_FUNCTION do_test () 32 | #include "../test-skeleton.c" 33 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/scanf3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int arc, char *argv[]) 6 | { 7 | int n, res; 8 | unsigned int val; 9 | char s[] = "111"; 10 | 11 | val = n = -1; 12 | res = sscanf(s, "%u %n", &val, &n); 13 | printf("Result of sscanf = %d\n", res); 14 | printf("Scanned format %%u = %u\n", val); 15 | printf("Possibly scanned format %%n = %d\n", n); 16 | if (n != 3 || val != 111 || res != 1) 17 | abort (); 18 | 19 | val = n = -1; 20 | res = sscanf(s, "%u%n", &val, &n); 21 | printf("Result of sscanf = %d\n", res); 22 | printf("Scanned format %%u = %u\n", val); 23 | printf("Possibly scanned format %%n = %d\n", n); 24 | if (n != 3 || val != 111 || res != 1) 25 | abort (); 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/10.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/10.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns EEXIST if the destination file does exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..14" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 create ${n0} 0644 15 | 16 | expect 0 create ${n1} 0644 17 | expect EEXIST link ${n0} ${n1} 18 | expect 0 unlink ${n1} 19 | 20 | expect 0 mkdir ${n1} 0755 21 | expect EEXIST link ${n0} ${n1} 22 | expect 0 rmdir ${n1} 23 | 24 | expect 0 symlink test ${n1} 25 | expect EEXIST link ${n0} ${n1} 26 | expect 0 unlink ${n1} 27 | 28 | expect 0 mkfifo ${n1} 0644 29 | expect EEXIST link ${n0} ${n1} 30 | expect 0 unlink ${n1} 31 | 32 | expect 0 unlink ${n0} 33 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdlib/testsort.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | compare (const void *a, const void *b) 7 | { 8 | return strcmp (*(char **) a, *(char **) b); 9 | } 10 | 11 | int 12 | main (void) 13 | { 14 | char bufs[500][20]; 15 | char *lines[500]; 16 | size_t lens[500]; 17 | size_t i, j; 18 | 19 | srandom (1); 20 | 21 | for (i = 0; i < 500; ++i) 22 | { 23 | lens[i] = random() % 19; 24 | lines[i] = bufs[i]; 25 | for (j = 0; j < lens[i]; ++j) 26 | lines[i][j] = random() % 26 + 'a'; 27 | lines[i][j] = '\0'; 28 | } 29 | 30 | qsort (lines, 500, sizeof (char *), compare); 31 | 32 | for (i = 0; i < 500 && lines[i] != NULL; ++i) 33 | puts (lines[i]); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/03.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..11" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 mkdir ${path1023} 0755 16 | expect 0 rmdir ${path1023} 17 | create_too_long 18 | expect ENAMETOOLONG mkdir ${too_long} 0755 #7 19 | unlink_too_long 20 | expect 0 rmdir ${path1021} 21 | expect 0 rmdir ${name255}/${name255}/${name255} 22 | expect 0 rmdir ${name255}/${name255} 23 | expect 0 rmdir ${name255} 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/03.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..11" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 mkfifo ${path1023} 0644 16 | expect 0 unlink ${path1023} 17 | create_too_long 18 | expect ENAMETOOLONG mkfifo ${too_long} 0644 19 | unlink_too_long 20 | expect 0 rmdir ${path1021} 21 | expect 0 rmdir ${name255}/${name255}/${name255} 22 | expect 0 rmdir ${name255}/${name255} 23 | expect 0 rmdir ${name255} 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/05.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/05.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns EACCES when search permission is denied for a component of the path prefix" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect 0 mkdir ${n1} 0755 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 21 | expect 0 chmod ${n1} 0644 22 | expect EACCES -u 65534 -g 65534 unlink ${n1}/${n2} 23 | expect 0 chmod ${n1} 0755 24 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 25 | expect 0 rmdir ${n1} 26 | cd ${cdir} 27 | expect 0 rmdir ${n0} 28 | -------------------------------------------------------------------------------- /lib/fs/nacl-mounts/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | 3 | #====================== taken from nacl-mounts 4 | # Add root of nacl-mounts to the include path 5 | CPPFLAGS += -I. 6 | CPPFLAGS += -I.. 7 | CPPFLAGS += -I../.. 8 | CPPFLAGS += -g -DDEBUG 9 | 10 | UTIL_SOURCES = $(addprefix $(CURDIR)/util/, Path.cc ) 11 | MEM_SOURCES = $(addprefix $(CURDIR)/memory/, MemMount.cc MemNode.cc) 12 | 13 | SOURCES = $(UTIL_SOURCES) $(MEM_SOURCES) 14 | OBJECTS = $(SOURCES:.cc=.o) 15 | #====================== 16 | 17 | all: libfs.a 18 | 19 | #use macros BASEFILE__ if no need full srcpath in log debug file 20 | %.o: %.cc 21 | $(CXX) $(CPPFLAGS) -DBASEFILE__=\"$(notdir $<)\" $< -o $@ 22 | 23 | libfs.a: $(OBJECTS) 24 | @$(AR) rc $@ $(OBJECTS) 25 | 26 | clean: 27 | @find -name "*.o" | xargs rm -f *.a *.o 28 | 29 | -------------------------------------------------------------------------------- /lib/original_nonpth_syscalls.h: -------------------------------------------------------------------------------- 1 | #ifndef __PTH_ZRT_H__ 2 | #define __PTH_ZRT_H__ 3 | 4 | #include //sleep, nanosleep 5 | #include //read, write 6 | #include 7 | 8 | unsigned int syscall_sleep(unsigned int seconds); 9 | 10 | int syscall_nanosleep(const struct timespec *req, struct timespec *rem); 11 | 12 | ssize_t syscall_read(int fd, void *buf, size_t count); 13 | 14 | ssize_t syscall_write(int fd, const void *buf, size_t count); 15 | 16 | int syscall_select(int nfds, fd_set *readfds, fd_set *writefds, 17 | fd_set *exceptfds, struct timeval *timeout); 18 | 19 | ssize_t syscall_pread(int fd, void *buf, size_t count, off_t offset); 20 | 21 | ssize_t syscall_pwrite(int fd, const void *buf, size_t count, off_t offset); 22 | 23 | #endif //__PTH_ZRT_H__ 24 | 25 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug8.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int 5 | main(int argc, char *argv[]) 6 | { 7 | char buf[100]; 8 | int point, x, y; 9 | int status = 0; 10 | 11 | sscanf("0x10 10", "%x %x", &x, &y); 12 | sprintf(buf, "%d %d", x, y); 13 | puts (buf); 14 | status |= strcmp (buf, "16 16"); 15 | sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y); 16 | sprintf(buf, "%d %d %d", point, x, y); 17 | status |= strcmp (buf, "0 1234 9876"); 18 | puts (buf); 19 | sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y); 20 | sprintf(buf, "%d %d %d", point, x, y); 21 | status |= strcmp (buf, "1 1234 9876"); 22 | puts (buf); 23 | 24 | puts (status ? "Test failed" : "Test passed"); 25 | 26 | return status; 27 | } 28 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/time/bug-asctime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | static int 8 | do_test (void) 9 | { 10 | int result = 0; 11 | time_t t = time (NULL); 12 | struct tm *tp = localtime (&t); 13 | tp->tm_year = INT_MAX; 14 | errno = 0; 15 | char *s = asctime (tp); 16 | if (s != NULL || errno != EOVERFLOW) 17 | { 18 | puts ("asctime did not fail correctly"); 19 | result = 1; 20 | } 21 | char buf[1000]; 22 | errno = 0; 23 | s = asctime_r (tp, buf); 24 | if (s != NULL || errno != EOVERFLOW) 25 | { 26 | puts ("asctime_r did not fail correctly"); 27 | result = 1; 28 | } 29 | return result; 30 | } 31 | 32 | #define TEST_FUNCTION do_test () 33 | #include "../test-skeleton.c" 34 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/lib/getpagesize.h: -------------------------------------------------------------------------------- 1 | /* Emulate getpagesize on systems that lack it. */ 2 | 3 | #ifndef HAVE_GETPAGESIZE 4 | 5 | #ifdef VMS 6 | #define getpagesize() 512 7 | #endif 8 | 9 | #ifdef HAVE_UNISTD_H 10 | #include 11 | #endif 12 | 13 | #ifdef _SC_PAGESIZE 14 | #define getpagesize() sysconf(_SC_PAGESIZE) 15 | #else 16 | 17 | #include 18 | 19 | #ifdef EXEC_PAGESIZE 20 | #define getpagesize() EXEC_PAGESIZE 21 | #else 22 | #ifdef NBPG 23 | #define getpagesize() NBPG * CLSIZE 24 | #ifndef CLSIZE 25 | #define CLSIZE 1 26 | #endif /* no CLSIZE */ 27 | #else /* no NBPG */ 28 | #ifdef NBPC 29 | #define getpagesize() NBPC 30 | #endif /* NBPC */ 31 | #endif /* no NBPG */ 32 | #endif /* no EXEC_PAGESIZE */ 33 | #endif /* no _SC_PAGESIZE */ 34 | 35 | #endif /* not HAVE_GETPAGESIZE */ 36 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/06.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns EACCES when write permission is denied on the directory containing the link to be removed" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..10" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect 0 mkdir ${n1} 0755 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 21 | expect 0 chmod ${n1} 0555 22 | expect EACCES -u 65534 -g 65534 unlink ${n1}/${n2} 23 | expect 0 chmod ${n1} 0755 24 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 25 | expect 0 rmdir ${n1} 26 | cd ${cdir} 27 | expect 0 rmdir ${n0} 28 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execlp1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static int 7 | do_test (void) 8 | { 9 | char *cwd = get_current_dir_name (); 10 | if (cwd == NULL) 11 | { 12 | puts ("get_current_dir_name failed"); 13 | return 1; 14 | } 15 | 16 | /* Make sure we do not find a binary with the name we are going to 17 | use. */ 18 | setenv ("PATH", cwd, 1); 19 | 20 | static const char prog[] = "does-not-exist"; 21 | errno = 0; 22 | execlp (prog, prog, NULL); 23 | 24 | if (errno != ENOENT) 25 | { 26 | printf ("errno = %d (%m), expected ENOENT\n", errno); 27 | return 1; 28 | } 29 | 30 | return 0; 31 | } 32 | 33 | #define TEST_FUNCTION do_test () 34 | #include "../test-skeleton.c" 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/04.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/04.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ENOENT if a component of the path name that must exist does not exist or O_CREAT is not set and the named file does not exist" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..4" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | if [ "${fs}" != "zrtfs" ] 16 | then 17 | expect ENOENT open ${n0}/${n1}/test O_CREAT 0644 18 | expect ENOENT open ${n0}/${n1} O_RDONLY 19 | else 20 | #zrtfs returning errno=ENOENT overwriten in further to EPERM in unexpected way 21 | expect EPERM open ${n0}/${n1}/test O_CREAT 0644 22 | expect EPERM open ${n0}/${n1} O_RDONLY 23 | fi 24 | expect 0 rmdir ${n0} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/14.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/14.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EROFS if the named file resides on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..5" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 mkdir ${n0}/${n1} 0755 21 | mount -ur /dev/md${n} 22 | expect EROFS rmdir ${n0}/${n1} 23 | mount -uw /dev/md${n} 24 | expect 0 rmdir ${n0}/${n1} 25 | umount /dev/md${n} 26 | mdconfig -d -u ${n} 27 | expect 0 rmdir ${n0} 28 | ;; 29 | *) 30 | quick_exit 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | CFLAGS+=-I. -Iintl -Ilib 3 | CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE 4 | CFLAGS+=-g -O 5 | 6 | HEADERS = lib/fnmatch.h lib/getopt.h lib/getpagesize.h lib/insremque.h lib/pathmax.h \ 7 | lib/safe-stat.h 8 | 9 | OBJECTS_NO_PREFIX = lib/getdate.o lib/getopt.o lib/getopt1.o lib/stpcpy.o \ 10 | lib/xgetcwd.o lib/xmalloc.o lib/xstrdup.o lib/tarwrapper.o \ 11 | src/buffer.o src/create.o src/diffarch.o src/extract.o src/gnu.o src/list.o \ 12 | src/mangle.o src/names.o src/port.o src/rtapelib.o src/update.o 13 | 14 | OBJECTS=$(addprefix $(CURDIR)/, $(OBJECTS_NO_PREFIX)) 15 | 16 | all: libtar.a 17 | 18 | libtar.a: $(OBJECTS) 19 | rm -f libtar.a 20 | $(AR) -cr libtar.a $(OBJECTS) 21 | $(RANLIB) libtar.a 22 | 23 | clean: 24 | @rm -f *.a *.o $(OBJECTS) src/*.o intl/*.o 25 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execvp1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static int 7 | do_test (void) 8 | { 9 | char *cwd = get_current_dir_name (); 10 | if (cwd == NULL) 11 | { 12 | puts ("get_current_dir_name failed"); 13 | return 1; 14 | } 15 | 16 | /* Make sure we do not find a binary with the name we are going to 17 | use. */ 18 | setenv ("PATH", cwd, 1); 19 | 20 | char *argv[] = { (char *) "does-not-exist", NULL }; 21 | errno = 0; 22 | execvp (argv[0], argv); 23 | 24 | if (errno != ENOENT) 25 | { 26 | printf ("errno = %d (%m), expected ENOENT\n", errno); 27 | return 1; 28 | } 29 | 30 | return 0; 31 | } 32 | 33 | #define TEST_FUNCTION do_test () 34 | #include "../test-skeleton.c" 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/12.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/12.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns EROFS if the named file resides on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..5" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 create ${n0}/${n1} 0644 21 | mount -ur /dev/md${n} 22 | expect EROFS unlink ${n0}/${n1} 23 | mount -uw /dev/md${n} 24 | expect 0 unlink ${n0}/${n1} 25 | umount /dev/md${n} 26 | mdconfig -d -u ${n} 27 | expect 0 rmdir ${n0} 28 | ;; 29 | *) 30 | quick_exit 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/elf/tst-addr1.x: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static int 6 | do_test (void) 7 | { 8 | Dl_info i; 9 | if (dladdr (&printf, &i) == 0) 10 | { 11 | puts ("not found"); 12 | return 1; 13 | } 14 | printf ("found symbol %s in %s\n", i.dli_sname, i.dli_fname); 15 | return i.dli_sname == NULL 16 | || (strcmp (i.dli_sname, "printf") != 0 17 | /* On architectures which create PIC code by default 18 | &printf may resolve to an address in libc.so 19 | rather than in the binary. printf and _IO_printf 20 | are aliased and which one comes first in the 21 | hash table is up to the linker. */ 22 | && strcmp (i.dli_sname, "_IO_printf") != 0); 23 | } 24 | 25 | #define TEST_FUNCTION do_test () 26 | #include "../test-skeleton.c" 27 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/redirect_pipe/test1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Test redirect_pipe 4 | #Both pipes are not directly linked and using file for IPC 5 | 6 | TEMP_PIPE=temp.p 7 | 8 | pkill redirect_pipe 9 | 10 | #create pipe for reading into tst-res.txt 11 | touch ipc_file.txt 12 | ./redirect_pipe -f ipc_file.txt -r > tst-res.txt & 13 | 14 | #create pipe $TEMP_PIPE for writing test files 15 | rm -f $TEMP_PIPE 16 | mkfifo $TEMP_PIPE 17 | cat $TEMP_PIPE | ./redirect_pipe -f ipc_file.txt -w & 18 | cat tst.txt > $TEMP_PIPE 19 | cat tst2.txt >> $TEMP_PIPE 20 | 21 | pkill redirect_pipe 22 | rm -f $TEMP_PIPE ipc_file.txt 23 | 24 | diff -q tst-res.txt tst-sum.txt 25 | if [ "$?" = "0" ] 26 | then 27 | rm -f tst-res.txt 28 | echo "test OK" 29 | exit 0; 30 | else 31 | rm -f tst-res.txt 32 | echo "test FAILED" 33 | exit 1; 34 | fi 35 | 36 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/03.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 mkdir ${path1023} 0755 16 | expect 0 rmdir ${path1023} 17 | expect ENOENT rmdir ${path1023} 18 | create_too_long 19 | expect ENAMETOOLONG rmdir ${too_long} 20 | unlink_too_long 21 | expect 0 rmdir ${path1021} 22 | expect 0 rmdir ${name255}/${name255}/${name255} 23 | expect 0 rmdir ${name255}/${name255} 24 | expect 0 rmdir ${name255} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/unlink/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/unlink/03.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="unlink returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 create ${path1023} 0644 16 | expect 0 unlink ${path1023} 17 | expect ENOENT unlink ${path1023} 18 | create_too_long 19 | expect ENAMETOOLONG unlink ${too_long} 20 | unlink_too_long 21 | expect 0 rmdir ${path1021} 22 | expect 0 rmdir ${name255}/${name255}/${name255} 23 | expect 0 rmdir ${name255}/${name255} 24 | expect 0 rmdir ${name255} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/03.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 create ${path1023} 0644 16 | expect 0 chmod ${path1023} 0642 17 | expect 0 unlink ${path1023} 18 | create_too_long 19 | expect ENAMETOOLONG chmod ${too_long} 0642 #8 20 | unlink_too_long 21 | expect 0 rmdir ${path1021} 22 | expect 0 rmdir ${name255}/${name255}/${name255} 23 | expect 0 rmdir ${name255}/${name255} 24 | expect 0 rmdir ${name255} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/03.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 create ${path1023} 0644 16 | expect 0 chown ${path1023} 65534 65534 17 | expect 0 unlink ${path1023} 18 | create_too_long 19 | expect ENAMETOOLONG chown ${too_long} 65533 65533 20 | unlink_too_long 21 | expect 0 rmdir ${path1021} 22 | expect 0 rmdir ${name255}/${name255}/${name255} 23 | expect 0 rmdir ${name255}/${name255} 24 | expect 0 rmdir ${name255} 25 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/truncate/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/truncate/03.t,v 1.1 2007/01/17 01:42:12 pjd Exp $ 3 | 4 | desc="truncate returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | expect 0 mkdir ${name255} 0755 12 | expect 0 mkdir ${name255}/${name255} 0755 13 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 14 | expect 0 mkdir ${path1021} 0755 15 | expect 0 create ${path1023} 0644 16 | expect 0 truncate ${path1023} 123 17 | expect 0 unlink ${path1023} 18 | create_too_long 19 | expect ENAMETOOLONG truncate ${too_long} 123 20 | unlink_too_long 21 | expect 0 rmdir ${path1021} 22 | expect 0 rmdir ${name255}/${name255}/${name255} 23 | expect 0 rmdir ${name255}/${name255} 24 | expect 0 rmdir ${name255} 25 | -------------------------------------------------------------------------------- /locale/locales: -------------------------------------------------------------------------------- 1 | ca_ES ISO-8859-1 2 | fi_FI ISO-8859-1 3 | it_IT ISO-8859-1 4 | nn_NO ISO-8859-1 5 | sv_SE ISO-8859-1 6 | cs_CZ ISO-8859-2 7 | fr_FR ISO-8859-1 8 | pl_PL ISO-8859-2 9 | th_TH TIS-620 10 | da_DK ISO-8859-1 11 | gl_ES ISO-8859-1 12 | pt_PT ISO-8859-1 13 | tr_TR ISO-8859-9 14 | de_DE ISO-8859-1 15 | he_IL ISO-8859-8 16 | ro_RO ISO-8859-2 17 | el_GR ISO-8859-7 18 | hr_HR ISO-8859-2 19 | lt_LT ISO-8859-13 20 | ru_RU ISO-8859-5 21 | es_ES ISO-8859-1 22 | hu_HU ISO-8859-2 23 | nb_NO ISO-8859-1 24 | sk_SK ISO-8859-2 25 | et_EE ISO-8859-1 26 | is_IS ISO-8859-1 27 | nl_NL ISO-8859-1 28 | sl_SI ISO-8859-2 29 | de_DE UTF-8 30 | en_US ISO-8859-1 31 | en_US UTF-8 32 | ru_RU UTF-8 33 | ru_RU KOI8-R 34 | ru_RU CP1251 35 | ru_UA KOI8-U 36 | ru_UA CP1251 37 | tr_TR UTF-8 38 | fa_IR UTF-8 39 | cs_CZ UTF-8 40 | ja_JP EUC-JP 41 | zh_TW EUC-TW 42 | en_US ANSI_X3.4-1968 43 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Makefile.env 2 | 3 | #CFLAGS+=-DHAS_LCHMOD 4 | #CFLAGS+=-DHAS_CHFLAGS 5 | #CFLAGS+=-DHAS_LCHFLAGS 6 | #CFLAGS+=-DHAS_TRUNCATE64 7 | #CFLAGS+=-DHAS_STAT64 8 | 9 | NAME=fstest 10 | NAME_TOOL=redirect_pipe/redirect_pipe 11 | 12 | 13 | all: $(NAME).nexe $(NAME_TOOL) run 14 | 15 | $(NAME).nexe: $(NAME).o 16 | $(CC) -o $(NAME).nexe $(NAME).o 17 | 18 | $(NAME_TOOL): $(NAME_TOOL).o 19 | gcc -o $(NAME_TOOL) $(NAME_TOOL).o 20 | 21 | $(NAME_TOOL).o: 22 | gcc -c -o $(NAME_TOOL).o -g $(NAME_TOOL).c 23 | 24 | run: 25 | sed s@{ABS_PATH}@${CURDIR}/@g $(NAME).manifest.template | sed s@{NAME}@$(NAME)@g > $(NAME).manifest 26 | chmod u+rwx fstest kill_fstest.sh run_test.sh run_zrtfs_tests.sh 27 | mkdir -p data 28 | 29 | clean: 30 | @rm -f $(NAME).nexe $(NAME_TOOL) rm *.o data/*.output data/*.log data/*.data *.manifest 31 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #$1 script path from current dir 4 | SCRIPT=$(readlink -f "$0") 5 | CURDIR=`dirname "$SCRIPT"` 6 | 7 | #create tar image to be injected into glibc fs 8 | tar -cf $CURDIR/mounts/tmp_dir.tar -C $CURDIR/mounts/glibc-fs tmp 9 | 10 | #run tests resides in glibc_test_suite/src folder 11 | make -C $CURDIR clean prepare 12 | make -C $CURDIR -j4 13 | 14 | echo -------------------------------------------- 15 | echo -n "Skiped tests need to be divided to valid-invalid lists, in section XCHECK: " 16 | find $CURDIR/xcheck -name "*.c" | wc -l 17 | echo -n "Skiped tests in section TODO: " 18 | find $CURDIR/todo -name "*.c" | wc -l 19 | echo -n "Skiped tests require depedencies XFAIL: " 20 | find $CURDIR/xfail -name "*.c" | wc -l 21 | echo -n "Skiped tests by NACL, in section XEXCLUDED: " 22 | find $CURDIR/xexcluded -name "*.c" | wc -l 23 | -------------------------------------------------------------------------------- /lib/zrtstub.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZRTSTUB_H__ 2 | #define __ZRTSTUB_H__ 3 | 4 | /*to avoid on zvm platform linkage errors */ 5 | #ifndef sigaction 6 | #define sigaction(a,b,c) (-1) 7 | #endif 8 | 9 | #ifndef waitpid 10 | #define waitpid(a,b,c) (-1) 11 | #endif 12 | 13 | #ifndef kill 14 | #define kill(a,b) (-1) 15 | #endif 16 | 17 | #ifndef fork 18 | #define fork() (-1) 19 | #endif 20 | 21 | #ifndef getgrgid 22 | #define getgrgid(a) (NULL) 23 | #endif 24 | 25 | #ifndef getgrgid_r 26 | #define getgrgid_r(a,b,c,d,e) (NULL) 27 | #endif 28 | 29 | #ifndef getgrnam 30 | #define getgrnam(a) (NULL) 31 | #endif 32 | 33 | #ifndef getgrnam_r 34 | #define getgrnam_r(a,b,c,d,e) (NULL) 35 | #endif 36 | 37 | #ifndef dlopen 38 | #define dlopen(a,b) (NULL) 39 | #define dlerror() (NULL) 40 | #define dlsym(a,b) (NULL) 41 | #define dlclose(a) (-1) 42 | #endif 43 | 44 | 45 | #endif //__ZRTSTUB_H__ 46 | 47 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug17.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static int 5 | do_test (void) 6 | { 7 | static const char expect[] = "0, 0, 0"; 8 | char buf[100]; 9 | int status = 0; 10 | 11 | static const char fmt1[] = "%0d, %0ld, %0lld"; 12 | snprintf (buf, sizeof (buf), fmt1, 0, 0L, 0LL); 13 | if (strcmp (buf, expect) != 0) 14 | { 15 | printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt1, buf, expect); 16 | status = 1; 17 | } 18 | 19 | static const char fmt2[] = "%0u, %0lu, %0llu"; 20 | snprintf (buf, sizeof (buf), fmt2, 0u, 0uL, 0uLL); 21 | if (strcmp (buf, expect) != 0) 22 | { 23 | printf ("\"%s\": got \"%s\", expected \"%s\"\n", fmt2, buf, expect); 24 | status = 1; 25 | } 26 | 27 | return status; 28 | } 29 | 30 | #define TEST_FUNCTION do_test () 31 | #include "../test-skeleton.c" 32 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chflags/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chflags/03.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chflags returns ENAMETOOLONG if an entire path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | require chflags 10 | 11 | echo "1..13" 12 | 13 | expect 0 mkdir ${name255} 0755 14 | expect 0 mkdir ${name255}/${name255} 0755 15 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 16 | expect 0 mkdir ${path1021} 0755 17 | expect 0 create ${path1023} 0644 18 | expect 0 chflags ${path1023} UF_IMMUTABLE 19 | expect 0 chflags ${path1023} none 20 | expect 0 unlink ${path1023} 21 | expect ENAMETOOLONG chflags ${path1024} UF_IMMUTABLE 22 | expect 0 rmdir ${path1021} 23 | expect 0 rmdir ${name255}/${name255}/${name255} 24 | expect 0 rmdir ${name255}/${name255} 25 | expect 0 rmdir ${name255} 26 | -------------------------------------------------------------------------------- /tests/lua_test_suite/README: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------- 3 | Lua Unit tests, based on Test suite for Lua 5.2.1 4 | source: www.lua.org 5 | --------------------------------------------------- 6 | {DOCPATH} 7 | 8 | 1.Lua test suite short brief. 9 | This suite contains nexe executable and test lua files: 10 | a) executable is used to load all tests at startup and just run lua 11 | script passed into command line of nexe; nexe executable is based on 12 | source file zrt/lib/lua-5.2.1/src/not_for_lib/lua.c that is part of 13 | original lua package ported to zerovm; 14 | b) test lua files are used inside of filesystem contains lua files 15 | and /tmp directory, and all of this are injected as tar archive via 16 | /dev/tarimage channel; 17 | 2.Build and run from command line: 18 | cd zrt/tests/lua_test/suite 19 | make 20 | run_tests.sh 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/11.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns ENOSPC if there are no free inodes on the file system on which the directory is being created" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..3" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 256k` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | i=0 21 | while :; do 22 | mkdir ${n0}/${i} >/dev/null 2>&1 23 | if [ $? -ne 0 ]; then 24 | break 25 | fi 26 | i=`expr $i + 1` 27 | done 28 | expect ENOSPC mkdir ${n0}/${n1} 0755 29 | umount /dev/md${n} 30 | mdconfig -d -u ${n} 31 | expect 0 rmdir ${n0} 32 | ;; 33 | *) 34 | quick_exit 35 | ;; 36 | esac 37 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/11.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns ENOSPC if there are no free inodes on the file system on which the file is being created" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..3" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 256k` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | i=0 21 | while :; do 22 | mkfifo ${n0}/${i} >/dev/null 2>&1 23 | if [ $? -ne 0 ]; then 24 | break 25 | fi 26 | i=`expr $i + 1` 27 | done 28 | expect ENOSPC mkfifo ${n0}/${n1} 0644 29 | umount /dev/md${n} 30 | mdconfig -d -u ${n} 31 | expect 0 rmdir ${n0} 32 | ;; 33 | *) 34 | quick_exit 35 | ;; 36 | esac 37 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/15.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/15.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EROFS when O_CREAT is specified and the named file would reside on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..5" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 open ${n0}/${n1} O_RDONLY,O_CREAT 0644 21 | expect 0 unlink ${n0}/${n1} 22 | mount -ur /dev/md${n} 23 | expect EROFS open ${n0}/${n1} O_RDONLY,O_CREAT 0644 24 | mount -uw /dev/md${n} 25 | umount /dev/md${n} 26 | mdconfig -d -u ${n} 27 | expect 0 rmdir ${n0} 28 | ;; 29 | *) 30 | quick_exit 31 | ;; 32 | esac 33 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/09.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/09.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns EROFS if the named file resides on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..7" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 mkdir ${n0}/${n1} 0755 21 | expect 0 rmdir ${n0}/${n1} 22 | mount -ur /dev/md${n} 23 | expect EROFS mkdir ${n0}/${n1} 0755 24 | mount -uw /dev/md${n} 25 | expect 0 mkdir ${n0}/${n1} 0755 26 | expect 0 rmdir ${n0}/${n1} 27 | umount /dev/md${n} 28 | mdconfig -d -u ${n} 29 | expect 0 rmdir ${n0} 30 | ;; 31 | *) 32 | quick_exit 33 | ;; 34 | esac 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/14.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/14.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns EXDEV if the source and the destination files are on different file systems" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..8" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | n2=`namegen` 16 | 17 | expect 0 mkdir ${n0} 0755 18 | n=`mdconfig -a -n -t malloc -s 1m` 19 | newfs /dev/md${n} >/dev/null 20 | mount /dev/md${n} ${n0} 21 | expect 0 create ${n0}/${n1} 0644 22 | expect EXDEV link ${n0}/${n1} ${n2} 23 | expect 0 unlink ${n0}/${n1} 24 | expect 0 create ${n1} 0644 25 | expect EXDEV link ${n1} ${n0}/${n2} 26 | expect 0 unlink ${n1} 27 | umount /dev/md${n} 28 | mdconfig -d -u ${n} 29 | expect 0 rmdir ${n0} 30 | ;; 31 | *) 32 | quick_exit 33 | ;; 34 | esac 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/08.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns EROFS if the named file resides on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..7" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 mkfifo ${n0}/${n1} 0644 21 | expect 0 unlink ${n0}/${n1} 22 | mount -ur /dev/md${n} 23 | expect EROFS mkfifo ${n0}/${n1} 0644 24 | mount -uw /dev/md${n} 25 | expect 0 mkfifo ${n0}/${n1} 0644 26 | expect 0 unlink ${n0}/${n1} 27 | umount /dev/md${n} 28 | mdconfig -d -u ${n} 29 | expect 0 rmdir ${n0} 30 | ;; 31 | *) 32 | quick_exit 33 | ;; 34 | esac 35 | -------------------------------------------------------------------------------- /libports/lua-5.2.1/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.39 2012/05/08 13:53:33 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "lobject.h" 11 | #include "lzio.h" 12 | 13 | /* load one chunk; from lundump.c */ 14 | LUAI_FUNC Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); 15 | 16 | /* make header; from lundump.c */ 17 | LUAI_FUNC void luaU_header (lu_byte* h); 18 | 19 | /* dump one chunk; from ldump.c */ 20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); 21 | 22 | /* data to catch conversion errors */ 23 | #define LUAC_TAIL "\x19\x93\r\n\x1a\n" 24 | 25 | /* size in bytes of header of binary files */ 26 | #define LUAC_HEADERSIZE (sizeof(LUA_SIGNATURE)-sizeof(char)+2+6+sizeof(LUAC_TAIL)-sizeof(char)) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/18.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/18.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EWOULDBLOCK when O_NONBLOCK and one of O_SHLOCK or O_EXLOCK is specified and the file is locked" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..6" 12 | 13 | n0=`namegen` 14 | 15 | expect 0 create ${n0} 0644 16 | expect 0 open ${n0} O_RDONLY,O_SHLOCK : open ${n0} O_RDONLY,O_SHLOCK,O_NONBLOCK 17 | expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_EXLOCK : open ${n0} O_RDONLY,O_EXLOCK,O_NONBLOCK 18 | expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_SHLOCK : open ${n0} O_RDONLY,O_EXLOCK,O_NONBLOCK 19 | expect "EWOULDBLOCK|EAGAIN" open ${n0} O_RDONLY,O_EXLOCK : open ${n0} O_RDONLY,O_SHLOCK,O_NONBLOCK 20 | expect 0 unlink ${n0} 21 | ;; 22 | *) 23 | quick_exit 24 | ;; 25 | esac 26 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/11.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ENOSPC if there are no free inodes on the file system on which the symbolic link is being created" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..3" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 256k` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | i=0 21 | while :; do 22 | ln -s test ${n0}/${i} >/dev/null 2>&1 23 | if [ $? -ne 0 ]; then 24 | break 25 | fi 26 | i=`expr $i + 1` 27 | done 28 | expect ENOSPC symlink test ${n0}/${n1} 29 | umount /dev/md${n} 30 | mdconfig -d -u ${n} 31 | expect 0 rmdir ${n0} 32 | ;; 33 | *) 34 | quick_exit 35 | ;; 36 | esac 37 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/05.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/05.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns EACCES when search permission is denied for a component of the path prefix" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect 0 mkdir ${n1} 0755 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 21 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 22 | expect 0 chmod ${n1} 0644 23 | expect EACCES -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 24 | expect 0 chmod ${n1} 0755 25 | expect 0 -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 26 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 27 | expect 0 rmdir ${n1} 28 | cd ${cdir} 29 | expect 0 rmdir ${n0} 30 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/dirent/tst-fdopendir2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | static int 9 | do_test (void) 10 | { 11 | char tmpl[] = "/tmp/tst-fdopendir2-XXXXXX"; 12 | int fd = mkstemp (tmpl); 13 | if (fd == -1) 14 | { 15 | puts ("cannot open temp file"); 16 | return 1; 17 | } 18 | 19 | errno = 0; 20 | DIR *d = fdopendir (fd); 21 | 22 | int e = errno; 23 | 24 | close (fd); 25 | unlink (tmpl); 26 | 27 | if (d != NULL) 28 | { 29 | puts ("fdopendir with normal file descriptor did not fail"); 30 | return 1; 31 | } 32 | if (e != ENOTDIR) 33 | { 34 | printf ("fdopendir set errno to %d, not %d as expected\n", e, ENOTDIR); 35 | return 1; 36 | } 37 | 38 | return 0; 39 | } 40 | 41 | #define TEST_FUNCTION do_test () 42 | #include "../test-skeleton.c" 43 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/io/tst-statvfs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | /* This test cannot detect many errors. But it will fail if the 6 | statvfs is completely hosed and it'll detect a missing export. So 7 | it is better than nothing. */ 8 | static int 9 | do_test (int argc, char *argv[]) 10 | { 11 | for (int i = 1; i < argc; ++i) 12 | { 13 | struct statvfs st; 14 | if (statvfs (argv[i], &st) != 0) 15 | printf ("%s: failed (%m)\n", argv[i]); 16 | else 17 | printf ("%s: free: %llu, mandatory: %s\n", argv[i], 18 | (unsigned long long int) st.f_bfree, 19 | #ifdef ST_MANDLOCK 20 | (st.f_flag & ST_MANDLOCK) ? "yes" : "no" 21 | #else 22 | "no" 23 | #endif 24 | ); 25 | } 26 | return 0; 27 | } 28 | 29 | #define TEST_FUNCTION do_test (argc, argv) 30 | #include "../test-skeleton.c" 31 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkfifo/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkfifo/06.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkfifo returns EACCES when write permission is denied on the parent directory of the file to be created" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect 0 mkdir ${n1} 0755 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 21 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 22 | expect 0 chmod ${n1} 0555 23 | expect EACCES -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 24 | expect 0 chmod ${n1} 0755 25 | expect 0 -u 65534 -g 65534 mkfifo ${n1}/${n2} 0644 26 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 27 | expect 0 rmdir ${n1} 28 | cd ${cdir} 29 | expect 0 rmdir ${n0} 30 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/00.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/00.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink creates symbolic links" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..14" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 create ${n0} 0644 15 | expect regular,0644 lstat ${n0} type,mode 16 | expect 0 symlink ${n0} ${n1} 17 | expect symlink lstat ${n1} type 18 | expect regular,0644 stat ${n1} type,mode 19 | expect 0 unlink ${n0} 20 | expect ENOENT stat ${n1} type,mode 21 | expect 0 unlink ${n1} 22 | 23 | expect 0 mkdir ${n0} 0755 24 | time=`${fstest} stat ${n0} ctime` 25 | sleep 1 26 | expect 0 symlink test ${n0}/${n1} 27 | mtime=`${fstest} stat ${n0} mtime` 28 | test_check $time -lt $mtime 29 | ctime=`${fstest} stat ${n0} ctime` 30 | test_check $time -lt $ctime 31 | expect 0 unlink ${n0}/${n1} 32 | expect 0 rmdir ${n0} 33 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/libio/tst-setvbuf1.c: -------------------------------------------------------------------------------- 1 | /* Dereived from the test case in BZ #2337. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | static char buf[512] __attribute__ ((aligned (4096))); 14 | 15 | 16 | static int 17 | do_test (void) 18 | { 19 | setlocale (LC_ALL, "de_DE.UTF-8"); 20 | 21 | FILE *fp = fdopen (dup (STDOUT_FILENO), "a"); 22 | if (fp == NULL) 23 | error (EXIT_FAILURE, errno, "fdopen(,\"a\")"); 24 | 25 | setvbuf (fp, buf, _IOFBF, sizeof (buf)); 26 | 27 | /* fwprintf to unbuffered stream. */ 28 | fwprintf (fp, L"hello.\n"); 29 | 30 | fclose (fp); 31 | 32 | /* touch my buffer */ 33 | buf[45] = 'a'; 34 | 35 | return 0; 36 | } 37 | 38 | #define TEST_FUNCTION do_test () 39 | #include "../test-skeleton.c" 40 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/posix/spawn_int.h: -------------------------------------------------------------------------------- 1 | /* Data structure to contain the action information. */ 2 | struct __spawn_action 3 | { 4 | enum 5 | { 6 | spawn_do_close, 7 | spawn_do_dup2, 8 | spawn_do_open 9 | } tag; 10 | 11 | union 12 | { 13 | struct 14 | { 15 | int fd; 16 | } close_action; 17 | struct 18 | { 19 | int fd; 20 | int newfd; 21 | } dup2_action; 22 | struct 23 | { 24 | int fd; 25 | const char *path; 26 | int oflag; 27 | mode_t mode; 28 | } open_action; 29 | } action; 30 | }; 31 | 32 | extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * 33 | file_actions); 34 | 35 | extern int __spawni (pid_t *pid, const char *path, 36 | const posix_spawn_file_actions_t *file_actions, 37 | const posix_spawnattr_t *attrp, char *const argv[], 38 | char *const envp[], int use_path); 39 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xfail/posix/spawn_int.h: -------------------------------------------------------------------------------- 1 | /* Data structure to contain the action information. */ 2 | struct __spawn_action 3 | { 4 | enum 5 | { 6 | spawn_do_close, 7 | spawn_do_dup2, 8 | spawn_do_open 9 | } tag; 10 | 11 | union 12 | { 13 | struct 14 | { 15 | int fd; 16 | } close_action; 17 | struct 18 | { 19 | int fd; 20 | int newfd; 21 | } dup2_action; 22 | struct 23 | { 24 | int fd; 25 | const char *path; 26 | int oflag; 27 | mode_t mode; 28 | } open_action; 29 | } action; 30 | }; 31 | 32 | extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * 33 | file_actions); 34 | 35 | extern int __spawni (pid_t *pid, const char *path, 36 | const posix_spawn_file_actions_t *file_actions, 37 | const posix_spawnattr_t *attrp, char *const argv[], 38 | char *const envp[], int use_path); 39 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/LICENSE: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2000, 2002 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU C Library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17 | 02111-1307 USA. */ -------------------------------------------------------------------------------- /tests/glibc_test_suite/xcheck/posix/spawn_int.h: -------------------------------------------------------------------------------- 1 | /* Data structure to contain the action information. */ 2 | struct __spawn_action 3 | { 4 | enum 5 | { 6 | spawn_do_close, 7 | spawn_do_dup2, 8 | spawn_do_open 9 | } tag; 10 | 11 | union 12 | { 13 | struct 14 | { 15 | int fd; 16 | } close_action; 17 | struct 18 | { 19 | int fd; 20 | int newfd; 21 | } dup2_action; 22 | struct 23 | { 24 | int fd; 25 | const char *path; 26 | int oflag; 27 | mode_t mode; 28 | } open_action; 29 | } action; 30 | }; 31 | 32 | extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t * 33 | file_actions); 34 | 35 | extern int __spawni (pid_t *pid, const char *path, 36 | const posix_spawn_file_actions_t *file_actions, 37 | const posix_spawnattr_t *attrp, char *const argv[], 38 | char *const envp[], int use_path); 39 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/06.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/06.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns EACCES if the parent directory of the file to be created denies write permission" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | 19 | expect 0 mkdir ${n1} 0755 20 | expect 0 chown ${n1} 65534 65534 21 | 22 | expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2} 23 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 24 | 25 | expect 0 chmod ${n1} 0555 26 | expect EACCES -u 65534 -g 65534 symlink test ${n1}/${n2} 27 | expect 0 chmod ${n1} 0755 28 | expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2} 29 | expect 0 unlink ${n1}/${n2} 30 | 31 | expect 0 rmdir ${n1} 32 | 33 | cd ${cdir} 34 | expect 0 rmdir ${n0} 35 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/tst-execvp3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | static void do_prepare (void); 9 | #define PREPARE(argc, argv) do_prepare () 10 | static int do_test (void); 11 | #define TEST_FUNCTION do_test () 12 | 13 | #include "../test-skeleton.c" 14 | 15 | 16 | static char *fname; 17 | 18 | static void 19 | do_prepare (void) 20 | { 21 | int fd = create_temp_file ("testscript", &fname); 22 | dprintf (fd, "echo foo\n"); 23 | fchmod (fd, 0700); 24 | close (fd); 25 | } 26 | 27 | 28 | static int 29 | do_test (void) 30 | { 31 | if (setenv ("PATH", test_dir, 1) != 0) 32 | { 33 | puts ("setenv failed"); 34 | return 1; 35 | } 36 | 37 | char *argv[] = { fname, NULL }; 38 | execvp (basename (fname), argv); 39 | 40 | /* If we come here, the execvp call failed. */ 41 | return 1; 42 | } 43 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/14.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/14.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EISDIR when the 'to' argument is a directory, but 'from' is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..17" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | 16 | expect 0 create ${n1} 0644 17 | expect EISDIR rename ${n1} ${n0} 18 | expect dir lstat ${n0} type 19 | expect regular lstat ${n1} type 20 | expect 0 unlink ${n1} 21 | 22 | expect 0 mkfifo ${n1} 0644 23 | expect EISDIR rename ${n1} ${n0} 24 | expect dir lstat ${n0} type 25 | expect fifo lstat ${n1} type 26 | expect 0 unlink ${n1} 27 | 28 | expect 0 symlink test ${n1} 29 | expect EISDIR rename ${n1} ${n0} 30 | expect dir lstat ${n0} type 31 | expect symlink lstat ${n1} type 32 | expect 0 unlink ${n1} 33 | 34 | expect 0 rmdir ${n0} 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/13.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/13.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ENOTDIR when the 'from' argument is a directory, but 'to' is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..17" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | 14 | expect 0 mkdir ${n0} 0755 15 | 16 | expect 0 create ${n1} 0644 17 | expect ENOTDIR rename ${n0} ${n1} 18 | expect dir lstat ${n0} type 19 | expect regular lstat ${n1} type 20 | expect 0 unlink ${n1} 21 | 22 | expect 0 mkfifo ${n1} 0644 23 | expect ENOTDIR rename ${n0} ${n1} 24 | expect dir lstat ${n0} type 25 | expect fifo lstat ${n1} type 26 | expect 0 unlink ${n1} 27 | 28 | expect 0 symlink test ${n1} 29 | expect ENOTDIR rename ${n0} ${n1} 30 | expect dir lstat ${n0} type 31 | expect symlink lstat ${n1} type 32 | expect 0 unlink ${n1} 33 | 34 | expect 0 rmdir ${n0} 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/10.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/10.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns EROFS if the file name2 would reside on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..7" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | n2=`namegen` 16 | 17 | expect 0 mkdir ${n0} 0755 18 | n=`mdconfig -a -n -t malloc -s 1m` 19 | newfs /dev/md${n} >/dev/null 20 | mount /dev/md${n} ${n0} 21 | 22 | expect 0 symlink test ${n0}/${n1} 23 | expect 0 unlink ${n0}/${n1} 24 | mount -ur /dev/md${n} 25 | expect EROFS symlink test ${n0}/${n1} 26 | mount -uw /dev/md${n} 27 | expect 0 symlink test ${n0}/${n1} 28 | expect 0 unlink ${n0}/${n1} 29 | 30 | umount /dev/md${n} 31 | mdconfig -d -u ${n} 32 | expect 0 rmdir ${n0} 33 | ;; 34 | *) 35 | quick_exit 36 | ;; 37 | esac 38 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/05.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/05.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns EACCES when a component of the name2 path prefix denies search permission" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..12" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | 19 | expect 0 mkdir ${n1} 0755 20 | expect 0 chown ${n1} 65534 65534 21 | 22 | expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2} 23 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 24 | 25 | expect 0 chmod ${n1} 0644 26 | expect EACCES -u 65534 -g 65534 symlink test ${n1}/${n2} 27 | expect 0 chmod ${n1} 0755 28 | expect 0 -u 65534 -g 65534 symlink test ${n1}/${n2} 29 | expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} 30 | 31 | expect 0 rmdir ${n1} 32 | 33 | cd ${cdir} 34 | expect 0 rmdir ${n0} 35 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/11.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/11.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns EPERM if the source file is a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | n0=`namegen` 10 | n1=`namegen` 11 | n2=`namegen` 12 | 13 | case "${os}:${fs}" in 14 | SunOS:UFS) 15 | echo "1..10" 16 | 17 | expect 0 mkdir ${n0} 0755 18 | expect 0 link ${n0} ${n1} 19 | expect 0 unlink ${n1} 20 | expect 0 rmdir ${n0} 21 | ;; 22 | *) 23 | echo "1..9" 24 | 25 | expect 0 mkdir ${n0} 0755 26 | expect EPERM link ${n0} ${n1} 27 | expect 0 rmdir ${n0} 28 | ;; 29 | esac 30 | 31 | expect 0 mkdir ${n0} 0755 32 | expect 0 chown ${n0} 65534 65534 33 | cdir=`pwd` 34 | cd ${n0} 35 | 36 | expect 0 -u 65534 -g 65534 mkdir ${n1} 0755 37 | expect EPERM -u 65534 -g 65534 link ${n1} ${n2} 38 | expect 0 -u 65534 -g 65534 rmdir ${n1} 39 | 40 | cd ${cdir} 41 | expect 0 rmdir ${n0} 42 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/19.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/19.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns ENOSPC when O_CREAT is specified, the file does not exist, and there are no free inodes on the file system on which the file is being created" 5 | 6 | 7 | dir=`dirname $0` 8 | . ${dir}/../misc.sh 9 | 10 | case "${os}:${fs}" in 11 | FreeBSD:UFS) 12 | echo "1..3" 13 | 14 | n0=`namegen` 15 | n1=`namegen` 16 | 17 | expect 0 mkdir ${n0} 0755 18 | n=`mdconfig -a -n -t malloc -s 256k` 19 | newfs /dev/md${n} >/dev/null 20 | mount /dev/md${n} ${n0} 21 | i=0 22 | while :; do 23 | touch ${n0}/${i} >/dev/null 2>&1 24 | if [ $? -ne 0 ]; then 25 | break 26 | fi 27 | i=`expr $i + 1` 28 | done 29 | expect ENOSPC open ${n0}/${i} O_RDONLY,O_CREAT 0644 30 | umount /dev/md${n} 31 | mdconfig -d -u ${n} 32 | expect 0 rmdir ${n0} 33 | ;; 34 | *) 35 | quick_exit 36 | ;; 37 | esac 38 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/02.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/02.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..14" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 mkdir ${name255} 0755 14 | expect 0 mkdir ${name255}/${name255} 0755 15 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 16 | expect 0 mkdir ${path1021} 0755 17 | expect 0 create ${n0} 0644 18 | expect 0 rename ${n0} ${path1023} 19 | expect 0 rename ${path1023} ${n0} 20 | expect ENAMETOOLONG rename ${n0} ${too_long} 21 | expect 0 unlink ${n0} 22 | create_too_long 23 | expect ENAMETOOLONG rename ${too_long} ${n0} 24 | unlink_too_long 25 | expect 0 rmdir ${path1021} 26 | expect 0 rmdir ${name255}/${name255}/${name255} 27 | expect 0 rmdir ${name255}/${name255} 28 | expect 0 rmdir ${name255} 29 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/07.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EACCES when search permission is denied for a component of the path prefix" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..10" 12 | else 13 | echo "1..5" 14 | fi 15 | 16 | n0=`namegen` 17 | n1=`namegen` 18 | n2=`namegen` 19 | 20 | expect 0 mkdir ${n0} 0755 21 | cdir=`pwd` 22 | cd ${n0} 23 | expect 0 mkdir ${n1} 0755 24 | expect 0 chown ${n1} 65534 65534 25 | 26 | if [ "${fs}" != "zrtfs" ] 27 | then 28 | expect 0 -u 65534 -g 65534 mkdir ${n1}/${n2} 0755 29 | expect 0 chmod ${n1} 0644 30 | expect EACCES -u 65534 -g 65534 rmdir ${n1}/${n2} 31 | expect 0 chmod ${n1} 0755 32 | expect 0 -u 65534 -g 65534 rmdir ${n1}/${n2} 33 | fi 34 | expect 0 rmdir ${n1} 35 | cd ${cdir} 36 | expect 0 rmdir ${n0} 37 | -------------------------------------------------------------------------------- /libports/sqlite3/vfs_channel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Description 3 | * 4 | * Copyright (c) 2012-2013, LiteStack, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef VFS_CHANNEL_H_ 20 | #define VFS_CHANNEL_H_ 21 | 22 | /* 23 | ** Name used to identify this VFS. 24 | */ 25 | #define FS_VFS_NAME "fs-channel" 26 | 27 | int register_fs_channel(int channel_id); 28 | 29 | #endif /* VFS_CHANNEL_H_ */ 30 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/TODO: -------------------------------------------------------------------------------- 1 | * TODO file for GNU tar -*- outline -*- 2 | 3 | Tell if you feel like volunteering for any 4 | of these ideas, listed more or less in decreasing order of priority. 5 | 6 | .@ ChangeLog 7 | 8 | .* Revise 3/rmail/{malloc,memcmp}. 9 | .* Rename --absolute-paths to --absolute-names 10 | .* Make so that --rsh-command may be used even if !HAVE_RTAPELIB. 11 | .* revise all NAMSIZ references, too often related to short buffers. 12 | .* current_link_name, current_file_name not always quoted when printed. 13 | .* Let DEVICE_PREFIX be configured from the environment. 14 | .* --ignore-failed-read might have been defeated. 15 | .* diffarch.c: confusion between stderr and stdlis, WARN and ERROR. 16 | .* create.c: diagnostics missing when `goto badfile'. 17 | .* split tar.h into genuine POSIX tar.h and system.h. 18 | .* error should have a way to emulate msg or msg_perror. 19 | .* Make a debugging feature out of all `#if 0'. 20 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/08.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/08.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns EACCES when write permission is denied on the directory containing the link to be removed" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..10" 12 | else 13 | echo "1..5" 14 | fi 15 | n0=`namegen` 16 | n1=`namegen` 17 | n2=`namegen` 18 | 19 | expect 0 mkdir ${n0} 0755 20 | cdir=`pwd` 21 | cd ${n0} 22 | expect 0 mkdir ${n1} 0755 23 | expect 0 chown ${n1} 65534 65534 24 | 25 | if [ "${fs}" != "zrtfs" ] 26 | then 27 | expect 0 -u 65534 -g 65534 mkdir ${n1}/${n2} 0755 28 | expect 0 chmod ${n1} 0555 29 | expect EACCES -u 65534 -g 65534 rmdir ${n1}/${n2} 30 | expect 0 chmod ${n1} 0755 31 | expect 0 -u 65534 -g 65534 rmdir ${n1}/${n2} 32 | fi 33 | expect 0 rmdir ${n1} 34 | cd ${cdir} 35 | expect 0 rmdir ${n0} 36 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/symlink/03.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/symlink/03.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="symlink returns ENAMETOOLONG if an entire length of either path name exceeded 1023 characters" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..14" 10 | 11 | n0=`namegen` 12 | 13 | expect 0 symlink ${path1023} ${n0} 14 | expect 0 unlink ${n0} 15 | expect 0 mkdir ${name255} 0755 16 | expect 0 mkdir ${name255}/${name255} 0755 17 | expect 0 mkdir ${name255}/${name255}/${name255} 0755 18 | expect 0 mkdir ${path1021} 0755 19 | expect 0 symlink ${n0} ${path1023} 20 | expect 0 unlink ${path1023} 21 | create_too_long 22 | expect ENAMETOOLONG symlink ${n0} ${too_long} 23 | expect ENAMETOOLONG symlink ${too_long} ${n0} 24 | unlink_too_long 25 | expect 0 rmdir ${path1021} 26 | expect 0 rmdir ${name255}/${name255}/${name255} 27 | expect 0 rmdir ${name255}/${name255} 28 | expect 0 rmdir ${name255} 29 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/tst-put-error.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | static int 9 | do_test (void) 10 | { 11 | char tmpl[] = "/tmp/tst-put-error.XXXXXX"; 12 | int fd = mkstemp (tmpl); 13 | if (fd == -1) 14 | error (EXIT_FAILURE, errno, "cannot create temporary file"); 15 | FILE *fp = fdopen (fd, "w"); 16 | if (fp == NULL) 17 | error (EXIT_FAILURE, errno, "fdopen"); 18 | setlinebuf (fp); 19 | close (fd); 20 | unlink (tmpl); 21 | int n = fprintf (fp, "hello world\n"); 22 | printf ("fprintf = %d\n", n); 23 | if (n >= 0) 24 | error (EXIT_FAILURE, 0, "first fprintf succeeded"); 25 | n = fprintf (fp, "hello world\n"); 26 | printf ("fprintf = %d\n", n); 27 | if (n >= 0) 28 | error (EXIT_FAILURE, 0, "second fprintf succeeded"); 29 | return 0; 30 | } 31 | 32 | #define TEST_FUNCTION do_test () 33 | #include "../test-skeleton.c" 34 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/open/16.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/open/16.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="open returns EMLINK/ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | quick_exit #zrtfs not support symlinks 10 | 11 | echo "1..6" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 symlink ${n0} ${n1} 17 | case "${os}" in 18 | FreeBSD) 19 | expect EMLINK open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 20 | expect EMLINK open ${n1} O_RDONLY,O_NOFOLLOW 21 | expect EMLINK open ${n1} O_WRONLY,O_NOFOLLOW 22 | expect EMLINK open ${n1} O_RDWR,O_NOFOLLOW 23 | ;; 24 | *) 25 | expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 26 | expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW 27 | expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW 28 | expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW 29 | ;; 30 | esac 31 | expect 0 unlink ${n1} 32 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/16.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/16.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EROFS if the requested link requires writing in a directory on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}" in 10 | FreeBSD) 11 | echo "1..8" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | n2=`namegen` 16 | 17 | expect 0 mkdir ${n0} 0755 18 | n=`mdconfig -a -n -t malloc -s 1m` 19 | newfs /dev/md${n} >/dev/null 20 | mount /dev/md${n} ${n0} 21 | expect 0 create ${n0}/${n1} 0644 22 | mount -ur /dev/md${n} 23 | 24 | expect EROFS rename ${n0}/${n1} ${n0}/${n2} 25 | expect EROFS rename ${n0}/${n1} ${n2} 26 | expect 0 create ${n2} 0644 27 | expect EROFS rename ${n2} ${n0}/${n2} 28 | expect 0 unlink ${n2} 29 | 30 | umount /dev/md${n} 31 | mdconfig -d -u ${n} 32 | expect 0 rmdir ${n0} 33 | ;; 34 | *) 35 | quick_exit 36 | ;; 37 | esac 38 | -------------------------------------------------------------------------------- /locale/locale_compiled/localedef/Makefile: -------------------------------------------------------------------------------- 1 | include $(ZRT_ROOT)/Makefile.env 2 | NAME=localedef 3 | 4 | #mandatory parameters expected 5 | #examples are 6 | #LANG_TERRITORY=hr_HR 7 | #CHARMAP=ISO-8859-2 8 | LANG_TERRITORY=de_DE 9 | CHARMAP=ISO-8859-1 10 | 11 | 12 | all: $(NAME).o 13 | $(CC) -o $(NAME).nexe $(NAME).o $(LDFLAGS) 14 | @sed s@{ABS_PATH}@${CURDIR}/@g $(NAME).manifest.template | \ 15 | sed s@{LANG_TERRITORY}@${LANG_TERRITORY}@g | \ 16 | sed s@{CHARMAP}@${CHARMAP}@g > $(NAME).manifest 17 | $(SETARCH) $(ZEROVM) -M$(NAME).manifest -v2 18 | cat stdout.data 19 | cat stderr.data 20 | 21 | archive: 22 | @sed s@{ABS_PATH}@${CURDIR}/@g $(NAME)-archive.manifest.template | \ 23 | sed s@{LANG_TERRITORY}@${LANG_TERRITORY}@g | \ 24 | sed s@{CHARMAP}@${CHARMAP}@g > $(NAME)-archive.manifest 25 | $(SETARCH) $(ZEROVM) -M$(NAME)-archive.manifest -v2 26 | cat stdout.data 27 | cat stderr.data 28 | 29 | clean: 30 | @rm -f $(NAME).nexe $(NAME)-archive.manifest $(NAME).o *.log *.data 31 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/link/05.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/link/05.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="link returns EMLINK if the link count of the file named by name1 would exceed 32767" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..5" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | n2=`namegen` 16 | 17 | expect 0 mkdir ${n0} 0755 18 | n=`mdconfig -a -n -t malloc -s 1m` 19 | newfs -i 1 /dev/md${n} >/dev/null 20 | mount /dev/md${n} ${n0} 21 | expect 0 create ${n0}/${n1} 0644 22 | i=1 23 | while :; do 24 | link ${n0}/${n1} ${n0}/${i} >/dev/null 2>&1 25 | if [ $? -ne 0 ]; then 26 | break 27 | fi 28 | i=`expr $i + 1` 29 | done 30 | test_check $i -eq 32767 31 | 32 | expect EMLINK link ${n0}/${n1} ${n0}/${n2} 33 | 34 | umount /dev/md${n} 35 | mdconfig -d -u ${n} 36 | expect 0 rmdir ${n0} 37 | ;; 38 | *) 39 | quick_exit 40 | ;; 41 | esac 42 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/elf/tst-tls10.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #if defined HAVE___THREAD && defined HAVE_TLS_MODEL_ATTRIBUTE 5 | # define USE_TLS__THREAD 6 | 7 | struct A 8 | { 9 | char a; 10 | int b; 11 | long long c; 12 | }; 13 | 14 | extern __thread struct A a1, a2, a3, a4; 15 | extern struct A *f1a (void); 16 | extern struct A *f2a (void); 17 | extern struct A *f3a (void); 18 | extern struct A *f4a (void); 19 | extern struct A *f5a (void); 20 | extern struct A *f6a (void); 21 | extern struct A *f7a (void); 22 | extern struct A *f8a (void); 23 | extern struct A *f9a (void); 24 | extern struct A *f10a (void); 25 | extern int f1b (void); 26 | extern int f2b (void); 27 | extern int f3b (void); 28 | extern int f4b (void); 29 | extern int f5b (void); 30 | extern int f6b (void); 31 | extern int f7b (void); 32 | extern int f8b (void); 33 | extern int f9b (void); 34 | extern int f10b (void); 35 | extern void check1 (void); 36 | extern void check2 (void); 37 | #endif 38 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chown/07.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chown/07.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chown returns EPERM if the operation would change the ownership, but the effective user ID is not the super-user and the process is not an owner of the file" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..11" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | cdir=`pwd` 17 | cd ${n0} 18 | expect 0 mkdir ${n1} 0755 19 | expect 0 chown ${n1} 65534 65534 20 | expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 21 | expect EPERM -u 65534 -g 65534 chown ${n1}/${n2} 65533 65533 22 | expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65534 65534 23 | expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65533 65533 24 | expect EPERM -u 65534 -g 65534 -- chown ${n1}/${n2} -1 65533 25 | expect 0 unlink ${n1}/${n2} 26 | expect 0 rmdir ${n1} 27 | cd ${cdir} 28 | expect 0 rmdir ${n0} 29 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/xexcluded/posix/test-vfork.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | void __attribute_noinline__ noop (void); 9 | 10 | #define NR 2 /* Exit code of the child. */ 11 | 12 | int 13 | main (void) 14 | { 15 | pid_t pid; 16 | int status; 17 | 18 | printf ("Before vfork\n"); 19 | fflush (stdout); 20 | pid = vfork (); 21 | if (pid == 0) 22 | { 23 | /* This will clobber the return pc from vfork in the parent on 24 | machines where it is stored on the stack, if vfork wasn't 25 | implemented correctly, */ 26 | noop (); 27 | _exit (NR); 28 | } 29 | else if (pid < 0) 30 | error (1, errno, "vfork"); 31 | printf ("After vfork (parent)\n"); 32 | if (waitpid (0, &status, 0) != pid 33 | || !WIFEXITED (status) || WEXITSTATUS (status) != NR) 34 | exit (1); 35 | 36 | return 0; 37 | } 38 | 39 | void 40 | noop () 41 | { 42 | } 43 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rename/20.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rename/20.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 | 4 | desc="rename returns EEXIST or ENOTEMPTY if the 'to' argument is a directory and is not empty" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | echo "1..16" 10 | 11 | n0=`namegen` 12 | n1=`namegen` 13 | n2=`namegen` 14 | 15 | expect 0 mkdir ${n0} 0755 16 | expect 0 mkdir ${n1} 0755 17 | 18 | expect 0 create ${n1}/${n2} 0644 19 | expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1} 20 | expect 0 unlink ${n1}/${n2} 21 | 22 | expect 0 mkdir ${n1}/${n2} 0755 23 | expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1} 24 | expect 0 rmdir ${n1}/${n2} 25 | 26 | expect 0 mkfifo ${n1}/${n2} 0644 27 | expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1} 28 | expect 0 unlink ${n1}/${n2} 29 | 30 | expect 0 symlink test ${n1}/${n2} 31 | expect "EEXIST|ENOTEMPTY" rename ${n0} ${n1} 32 | expect 0 unlink ${n1}/${n2} 33 | 34 | expect 0 rmdir ${n1} 35 | expect 0 rmdir ${n0} 36 | -------------------------------------------------------------------------------- /libports/tar-1.11.8/src/ansi2knr.1: -------------------------------------------------------------------------------- 1 | .TH ANSI2KNR 1 "31 December 1990" 2 | .SH NAME 3 | ansi2knr \- convert ANSI C to Kernighan & Ritchie C 4 | .SH SYNOPSIS 5 | .I ansi2knr 6 | input_file output_file 7 | .SH DESCRIPTION 8 | If no output_file is supplied, output goes to stdout. 9 | .br 10 | There are no error messages. 11 | .sp 12 | .I ansi2knr 13 | recognizes functions by seeing a non-keyword identifier at the left margin, followed by a left parenthesis, with a right parenthesis as the last character on the line. It will recognize a multi-line header if the last character on each line but the last is a left parenthesis or comma. These algorithms ignore whitespace and comments, except that the function name must be the first thing on the line. 14 | .sp 15 | The following constructs will confuse it: 16 | .br 17 | - Any other construct that starts at the left margin and follows the above syntax (such as a macro or function call). 18 | .br 19 | - Macros that tinker with the syntax of the function header. 20 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/misc/tst-mntent2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | int 7 | main (void) 8 | { 9 | int result = 0; 10 | struct mntent mef; 11 | 12 | mef.mnt_fsname = strdupa ("/dev/sdf6"); 13 | mef.mnt_dir = strdupa ("/some dir"); 14 | mef.mnt_type = strdupa ("ext3"); 15 | mef.mnt_opts = strdupa ("opt1,opt2,noopt=6,rw,norw,brw"); 16 | mef.mnt_freq = 1; 17 | mef.mnt_passno = 2; 18 | 19 | #define TEST(opt, found) \ 20 | if (!!hasmntopt (&mef, (opt)) != (found)) \ 21 | { \ 22 | printf ("Option %s was %sfound\n", (opt), (found) ? "not " : ""); \ 23 | result = 1; \ 24 | } 25 | 26 | TEST ("opt1", 1) 27 | TEST ("opt2", 1) 28 | TEST ("noopt", 1) 29 | TEST ("rw", 1) 30 | TEST ("norw", 1) 31 | TEST ("brw", 1) 32 | TEST ("opt", 0) 33 | TEST ("oopt", 0) 34 | TEST ("w", 0) 35 | TEST ("r", 0) 36 | TEST ("br", 0) 37 | TEST ("nor", 0) 38 | TEST ("or", 0) 39 | 40 | return result; 41 | } 42 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/mkdir/10.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/mkdir/10.t,v 1.1 2007/01/17 01:42:09 pjd Exp $ 3 | 4 | desc="mkdir returns EEXIST if the named file exists" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "$fs" != "zrtfs" ] 10 | then 11 | echo "1..12" 12 | else 13 | echo "1..6" 14 | fi 15 | 16 | n0=`namegen` 17 | 18 | expect 0 mkdir ${n0} 0755 19 | expect EEXIST mkdir ${n0} 0755 20 | expect 0 rmdir ${n0} 21 | 22 | expect 0 create ${n0} 0644 23 | expect EEXIST mkdir ${n0} 0755 24 | expect 0 unlink ${n0} 25 | 26 | if [ "$fs" != "zrtfs" ] #symlink does not supported by zrtfs; excluded 3 tests 27 | then 28 | expect 0 symlink test ${n0} 29 | expect EEXIST mkdir ${n0} 0755 30 | expect 0 unlink ${n0} 31 | fi 32 | 33 | if [ "$fs" != "zrtfs" ] #pipes does not supported by zrtfs; excluded 3 tests 34 | then 35 | expect 0 mkfifo ${n0} 0644 36 | expect EEXIST mkdir ${n0} 0755 37 | expect 0 unlink ${n0} 38 | fi 39 | 40 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/rmdir/01.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/rmdir/01.t,v 1.1 2007/01/17 01:42:11 pjd Exp $ 3 | 4 | desc="rmdir returns ENOTDIR if a component of the path is not a directory" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | if [ "${fs}" != "zrtfs" ] 10 | then 11 | echo "1..14" 12 | else 13 | echo "1..8" 14 | fi 15 | 16 | n0=`namegen` 17 | n1=`namegen` 18 | 19 | expect 0 mkdir ${n0} 0755 20 | expect 0 create ${n0}/${n1} 0644 21 | expect ENOTDIR rmdir ${n0}/${n1}/test 22 | expect 0 unlink ${n0}/${n1} 23 | expect 0 rmdir ${n0} 24 | 25 | expect 0 create ${n0} 0644 26 | expect ENOTDIR rmdir ${n0} 27 | expect 0 unlink ${n0} 28 | 29 | if [ "${fs}" != "zrtfs" ] #zrtfs not support symlinks, pipes; excluded 6tests 30 | then 31 | expect 0 symlink ${n1} ${n0} 32 | expect ENOTDIR rmdir ${n0} 33 | expect 0 unlink ${n0} 34 | 35 | expect 0 mkfifo ${n0} 0644 36 | expect ENOTDIR rmdir ${n0} 37 | expect 0 unlink ${n0} 38 | fi 39 | -------------------------------------------------------------------------------- /lib/fs/transparent_mount.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filesystem interface implementation. 3 | * 4 | * Copyright (c) 2012-2013, LiteStack, Inc. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef TRANSPARENT_MOUNT_H_ 20 | #define TRANSPARENT_MOUNT_H_ 21 | 22 | struct MountsPublicInterface; 23 | struct MountsManager; 24 | 25 | struct MountsPublicInterface* alloc_transparent_mount( struct MountsManager* mounts_manager ); 26 | 27 | #endif /* TRANSPARENT_MOUNT_H_ */ 28 | -------------------------------------------------------------------------------- /tests/glibc_test_suite/src/stdio-common/bug20.c: -------------------------------------------------------------------------------- 1 | /* BZ #5225 */ 2 | #include 3 | #include 4 | #include 5 | 6 | static int 7 | do_test (void) 8 | { 9 | wchar_t in[] = L"123,abc,321"; 10 | /* This is the critical part for this test. format must be in 11 | read-only memory. */ 12 | static const wchar_t format[50] = L"%d,%[^,],%d"; 13 | int out_d1, out_d2; 14 | char out_s[50]; 15 | printf ("in='%ls' format='%ls'\n", in, format); 16 | if (swscanf (in, format, &out_d1, out_s, &out_d2) != 3) 17 | { 18 | puts ("swscanf did not return 3"); 19 | return 1; 20 | } 21 | printf ("in='%ls' format='%ls'\n", in, format); 22 | printf ("out_d1=%d out_s='%s' out_d2=%d\n", out_d1, out_s, out_d2); 23 | if (out_d1 != 123 || strcmp (out_s, "abc") != 0 || out_d2 != 321) 24 | { 25 | puts ("swscanf did not return the correct values"); 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | #define TEST_FUNCTION do_test () 32 | #include "../test-skeleton.c" 33 | -------------------------------------------------------------------------------- /tests/pjd-fstest-20080816/tests/chmod/09.t: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $FreeBSD: src/tools/regression/fstest/tests/chmod/09.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 | 4 | desc="chmod returns EROFS if the named file resides on a read-only file system" 5 | 6 | dir=`dirname $0` 7 | . ${dir}/../misc.sh 8 | 9 | case "${os}:${fs}" in 10 | FreeBSD:UFS) 11 | echo "1..10" 12 | 13 | n0=`namegen` 14 | n1=`namegen` 15 | 16 | expect 0 mkdir ${n0} 0755 17 | n=`mdconfig -a -n -t malloc -s 1m` 18 | newfs /dev/md${n} >/dev/null 19 | mount /dev/md${n} ${n0} 20 | expect 0 create ${n0}/${n1} 0644 21 | expect 0 chmod ${n0}/${n1} 0640 22 | expect 0640 stat ${n0}/${n1} mode 23 | mount -ur /dev/md${n} 24 | expect EROFS chmod ${n0}/${n1} 0600 25 | expect 0640 stat ${n0}/${n1} mode 26 | mount -uw /dev/md${n} 27 | expect 0 chmod ${n0}/${n1} 0600 28 | expect 0600 stat ${n0}/${n1} mode 29 | expect 0 unlink ${n0}/${n1} 30 | umount /dev/md${n} 31 | mdconfig -d -u ${n} 32 | expect 0 rmdir ${n0} 33 | ;; 34 | *) 35 | quick_exit 36 | ;; 37 | esac 38 | --------------------------------------------------------------------------------