aboutsummaryrefslogtreecommitdiff
path: root/contrib/netbsd-tests/lib/libc/sys
Commit message (Collapse)AuthorAgeFilesLines
* vfs: Fix vop_stdis_text()Mark Johnston2024-11-191-0/+35
| | | | | | | | | | | | | | | atomic(9) primitives are documented as operating on unsigned types. Here, we need a cast to avoid a tautological comparison. Add a regression test for access(2), which was affected by the bug. Reported by: NetApp Reviewed by: kib Fixes: e511bd1406fa ("vfs: fully lockless v_writecount adjustment") MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D47672
* man filesystems: fix more xrefs after move to s4Alexander Ziaee2024-06-281-3/+3
| | | | | | Fixes: 1a720cbec513 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1282
* netbsd-tests: Remove some pointless sleeps from message queue testsMark Johnston2023-03-103-6/+0
| | | | | | | | | | - In the msgctl tests, there is no point in sleeping after a fork(). Just block immediately in wait(). - In non-blocking send/recv tests, just wait for the child to exit once it's reached a message limit. If a bug prevents the child from exiting promptly, the test will time out. MFC after: 1 week
* netbsd-tests: Fix the libc stat_socket testMark Johnston2022-01-141-7/+4
| | | | | | | | | | | The test tries to connect a socket to a closed port at 127.0.0.1. It sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from connect(2), but this is not guaranteed, ECONNREFUSED is possible. Handle both cases, and re-enable the test. PR: 240621 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Revert "Disable flaky test lib.libc.sys.setrlimit_test.setrlimit_stack"Mark Johnston2022-01-141-3/+0
| | | | | | | | | | | The stack gap implementation is disabled by default now, so the test passes. This reverts commit dad71022bd7a8f95ab2ba656bec61e2424a1c3c5. PR: 259969 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Revert "t_setrlimit: Adjust resource limit to 20M"Marcin Wojtas2021-12-201-4/+0
| | | | | | | This reverts commit 4f741801d86089a1c5d631ba1e0f1421cdcf7a7e. As per discussion in PR: 260303 the reverted patch covered the real issue with a fixed address of the top of the stack.
* t_setrlimit: Adjust resource limit to 20MDawid Gorecki2021-12-201-0/+4
| | | | | | | | | | | | | With ASLR enabled by default, RLIMIT_STACK test fails due to the fact that default stack gap can be as big as 15M. Because of that the resource limit of 4M results in test program receiving SIGSEGV immediately after exiting the setrlimit syscall. Since the idea of this test is to check if rlim_cur does not extend past rlim_max, adjusting the resource limit to 20M should not invalidate the test results. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D33116
* t_mlock.c: Remove null_errno, it is write-onlyKonstantin Belousov2021-11-291-8/+0
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Disable flaky test lib.libc.sys.setrlimit_test.setrlimit_stackLi-Wen Hsu2021-11-281-0/+3
| | | | | PR: 259969 Sponsored by: The FreeBSD Foundation
* libc/tests: Correctly compare si_status from wait6()Jilles Tjoelker2021-07-251-1/+1
| | | | | | | | Fix erroneous = that was meant to be ==. Revision 1.10 from NetBSD t_wait.c Obtained from: NetBSD
* t_getgroups: No longer expected to failWarner Losh2021-06-021-3/+0
| | | | Sponsored by: Netflix
* Fix two failing tests after ATF updateAlex Richardson2021-02-152-6/+23
| | | | | | | | | | | | | | | | | | | | | Since https://github.com/freebsd/atf/commit/4581cefc1e3811dd3c926b5dd4b15fd63d2e19da ATF opens the results file on startup. This fixes problems like capsicumized tests not being able to open the file on exit. However, this test closes all file descriptors just to check that socketpair returns fd 3+4 and thereby also closes the ATF results file. This then results in an EBADF when writing the result so the test is reported as broken. While system calls that create new file descriptors (must?) use the lowest available file descriptor number, it does not seem useful to test this property here. Drop the check for FD==3/4 to unbreak the testsuite. We could also try to re-open the results file in ATF if we get a EBADF error, but that will fail when running under Capsicum. Reviewed By: cem Differential Revision: https://reviews.freebsd.org/D28683
* [tests] Fix itimer test warning-errors on gcc-6.4Adrian Chadd2020-10-151-2/+2
| | | | | | | | | | | This fixes a "suggested parens" compile warning-into-error that shows up on gcc-6.4. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D26789 Notes: svn path=/head/; revision=366727
* fix setitimer test for returned it_valueEric van Gyzen2020-10-011-2/+4
| | | | | | | | | | | | An old it_value of {4,3} is valid. Allow it. Reviewed by: bdrewery MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26445 Notes: svn path=/head/; revision=366346
* Adjust tests after page fault changes in r352807Jilles Tjoelker2019-09-291-4/+0
| | | | | | | | | | Commit r352807 fixed various signal numbers and codes from page faults; adjust the tests so they expect the fixes to be present. PR: 211924 Notes: svn path=/head/; revision=352869
* Temporarily skip flakey test case lib.libc.sys.stat_test.stat_socketLi-Wen Hsu2019-09-171-0/+3
| | | | | | | | PR: 240621 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=352448
* Add missing mode in open(2) calls with O_CREAT.Brooks Davis2019-07-164-10/+10
| | | | | | | | | | | | | | | | | When O_CREAT is specified, the third, variadic argument is required as the permission. If on is not passed, then depending on the ABI, either the contents of the third argument register or some arbitrary stuff on the stack will be used as the permission. This has been merged to NetBSD. Reviewed by: asomers, ngie Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20972 Notes: svn path=/head/; revision=350067
* Provide separate accounting for user-wired pages.Mark Johnston2019-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Notes: svn path=/head/; revision=347532
* Replace __riscv__ with __riscv.Ruslan Bukin2018-08-031-2/+2
| | | | | | | | | __riscv__ is not pre-defined anymore by latest version of GNU compiler. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337238
* Stop writing past the end of the buffer in the msgget_limit test. The valueAndrew Turner2018-07-191-1/+0
| | | | | | | | | | in i is already correct to write to the last item in the buf array. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=336492
* nanosleep(2): Fix bogus incrementing of rmtp by tc_tick_sbt on [EINTR].Bryan Drewery2018-02-141-0/+81
| | | | | | | | | | | | | | | | | | | | | sbt is the time in the future that the tsleep_sbt() is expected to be completed at. sbtt is the current time. Depending on the precision with sysctl kern.timecounter.alloweddeviation the start time may be incremented by tc_tick_sbt. The same increment is needed for the current time of sbtt before calculating the difference. The impact of missing this increment is that rmtp may increase by one tc_tick_sbt on every early [EINTR] return. If the same struct is passed in for rqtp as rmtp this can result in rqtp effectively incrementing by tc_tick_sbt and sleeping longer than originally intended. This problem was introduced in r247797. Reviewed by: kib, markj, vangyzen (all on an older version of the test) MFC after: 2 weeks Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14362 Notes: svn path=/head/; revision=329271
* Convert tools/regression/sockets/socketpair to ATFAlan Somers2018-02-101-5/+55
| | | | | | | | | Reviewed by: cem MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14305 Notes: svn path=/head/; revision=329108
* Update limits on makecontext() arguments in the setcontext_link test.John Baldwin2018-01-311-12/+12
| | | | | | | | | | | sparc64 and riscv do not support 10 arguments, but MIPS now does. While here, combine clauses for architectures that support the same number of arguments to reduce duplication. Sponsored by: DARPA / AFRL Notes: svn path=/head/; revision=328634
* mlock(2): correct documentation for error conditions.Alan Somers2018-01-221-18/+99
| | | | | | | | | | | | | | | The man page is years out of date regarding errors. Our implementation _does_ allow unaligned addresses, and it _does_not_ check for negative lengths, because the length is unsigned. It checks for overflow instead. Update the tests accordingly. Reviewed by: bcr MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D13826 Notes: svn path=/head/; revision=328266
* o Replace __riscv__ with __riscvRuslan Bukin2017-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Replace __riscv64 with (__riscv && __riscv_xlen == 64) This is required to support new GCC 7.1 compiler. This is compatible with current GCC 6.1 compiler. RISC-V is extensible ISA and the idea here is to have built-in define per each extension, so together with __riscv we will have some subset of these as well (depending on -march string passed to compiler): __riscv_compressed __riscv_atomic __riscv_mul __riscv_div __riscv_muldiv __riscv_fdiv __riscv_fsqrt __riscv_float_abi_soft __riscv_float_abi_single __riscv_float_abi_double __riscv_cmodel_medlow __riscv_cmodel_medany __riscv_cmodel_pic __riscv_xlen Reviewed by: ngie Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D11901 Notes: svn path=/head/; revision=322168
* Skip tests depending on coredumps if coredumps are disabled via kern.coredump.John Baldwin2017-05-161-0/+12
| | | | | | | | | | | | | | | The kern.coredump sysctl can be set to 0 to disable coredumps. Skip the 'status_coredump' and 'wait6_coredumped' tests if this sysctl is set to 0 rather than reporting a failure. Submitted by: brooks Reviewed by: ngie Obtained from: CheriBSD Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10665 Notes: svn path=/head/; revision=318363
* Annotate all changes made in r316178-r316180 with __FreeBSD__Enji Cooper2017-03-302-0/+36
| | | | | | | | | | | | Restore the stock (upstream) code under an #else block, so it's easier for me to visualize and understand the code that needs to be upstreamed. MFC after: 2 months X-MFC with: r316178, r316179, r316180 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316260
* t_msgctl: Fix the same msgsnd() misuse as t_msgsndConrad Meyer2017-03-291-2/+2
| | | | | | | | | | | | msgsnd(2)'s msgsz argument does not describe the full structure, only the message component. Reported by: Coverity CIDs: 1368703, 1368711 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316181
* Follow-up to r316179: More of the sameConrad Meyer2017-03-291-6/+6
| | | | | | | | | Reported by: Coverity CIDs: 1368705, 1368706, 1368707, 1368710 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316180
* t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflowConrad Meyer2017-03-291-1/+1
| | | | | | | | | | | | | msgsnd's msgsz argument is the size of the message following the 'long' message type. Don't include the message type in the size of the message when invoking msgsnd(2). Reported by: Coverity CID: 1368712 Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316179
* Add clock_nanosleep()Eric van Gyzen2017-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Reviewed by: kib, ngie, jilles MFC after: 3 weeks Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10020 Notes: svn path=/head/; revision=315526
* Add #else case in run(..) to fix test on non-{amd64,arm64,mips} afterEnji Cooper2017-02-071-0/+3
| | | | | | | recent refactoring to the test Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=313382
* Add back #else block accidentally removed in r312145Enji Cooper2017-01-181-0/+2
| | | | | | | This fixes the build with !(amd64|arm64|mips*) Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312376
* Use sys/param.h instead of sys/types.h to prep for upstreaming to NetBSDEnji Cooper2017-01-161-1/+1
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312300
* Remove unnecessary whitespace diffEnji Cooper2017-01-161-0/+1
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312299
* Merge ^/vendor/NetBSD/tests/dist@r312294Enji Cooper2017-01-162-11/+5
| | | | | | | | | This includes a number of accepted upstream fixes, as well as a reimplementation of the net/carp/... testcase (which is currently unused). Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312295
* Diff reduce with upstream and consolidate #ifdefs where possibleEnji Cooper2017-01-154-15/+4
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312243
* Pull in ^/vendor/NetBSD/tests/dist@r312219Enji Cooper2017-01-153-47/+9
| | | | | | | Remove divergence with upstream where possible Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312221
* Fix the build using hunks pending upstream contributionsEnji Cooper2017-01-141-0/+4
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312155
* Diff reduce with upstream by taking diff hunks that were contributed backEnji Cooper2017-01-1411-47/+13
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312149
* Readd the CMSG_DATA for assigning the kqueue... this testcase isn't officiallyEnji Cooper2017-01-141-0/+4
| | | | | | | correct yet, but it's getting closer. Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312148
* Remove extra EVSET I added in r312146 by accidentEnji Cooper2017-01-141-1/+0
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312147
* Diff reduce with upstreamEnji Cooper2017-01-141-22/+4
| | | | | | | | Use CMSG_FIRSTHDR macro to properly link the kqueue to the socket to get it to now return -1/EBADF with sendmsg per the testcase expectations Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312146
* Try to consolidate the #ifdef soup into FreeBSD vs non-FreeBSD blocks betterEnji Cooper2017-01-141-6/+10
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312145
* Diff reduce with upstreamEnji Cooper2017-01-141-0/+1
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312142
* Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123Enji Cooper2017-01-1426-165/+82
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312126
* Upgrade NetBSD tests to 01.11.2017_23.20 snapshotEnji Cooper2017-01-134-0/+442
| | | | | | | | | | | | | | | This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386 MFC after: 1 month Notes: svn path=/head/; revision=312008
* Fix lib/libc/sys/access_test after r311925Enji Cooper2017-01-121-1/+5
| | | | | | | | | sys/param.h needs to be #included in order for __FreeBSD_version to be checked MFC after: 13 days Notes: svn path=/head/; revision=311968
* Import testcase updates with code contributed back to NetBSDEnji Cooper2017-01-115-53/+102
| | | | | | | | | | | This also (inadvertently) contains an update to contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases). MFC after: 2 weeks In collaboration with: christos@NetBSD.org Notes: svn path=/head/; revision=311925
* Partially revert r311236Enji Cooper2017-01-111-10/+0
| | | | | | | | | | | | There's no sense in trying to close a file descriptor from the negative cases with unlink_test; it's best to ignore these cases. The mkfifo case does make sense to keep though. MFC after: 3 days Notes: svn path=/head/; revision=311919