summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Clean up the vcs ID stringsjhb2019-02-011-3/+2
| | | | | | | | | | | | | | | | | | | in libc's gen/ directory. - Move CSRG IDs into __SCCSID(). - When a file has been copied, consistently use 'From: <tag>' for strings referencing the version of the source file copied from in the license block comment. - Some of the 'From:' tags were using $FreeBSD$ that was being expanded on each checkout. Fix those to hardcode the FreeBSD tag from the file that was copied at the time of the copy. - When multiple strings are present list them in "chronological" order, so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from OtherBSD and contains a CSRG ID from the OtherBSD file, use the order CSRG -> OtherBSD -> FreeBSD. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15831
* Renumber copyright clause 4imp2019-02-011-1/+1
| | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96
* scandir: Update copyright notice from FreeBSDSebastian Huber2019-02-011-3/+3
| | | | Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
* General further adoption of SPDX licensing ID tags.pfg2019-02-011-0/+2
| | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
* Cygwin: x86_64: pthreads: Install exception handler after switching stackCorinna Vinschen2019-01-301-0/+2
| | | | | | | | | | After creating a pthread, the stack gets moved to the desired memory location. While the 32 bit thread wrapper copies the exception handler information to the new stack (so we have at least *some* exception handler present), the x86_64 code didn't perform any exception handler magic. Fix that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: document W10 1803 per-directory case-sensitivity behaviourCorinna Vinschen2019-01-301-0/+33
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork: fix child process permissions, take 2Corinna Vinschen2019-01-303-17/+8
| | | | | | | | | | | | | VirtualQueryEx, called by fixup_mmaps_after_fork, requires PROCESS_QUERY_INFORMATION permissions per MSDN. However, testing shows that PROCESS_QUERY_LIMITED_INFORMATION is sufficient when running the same code on Windows 8.1 or Windows 10. Fix the code to give the forked child always PROCESS_QUERY_INFORMATION perms on Windows Vista/7 and respective server releases. Revert now unneeded patch to check_token_membership as well. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: raise: change to call pthread_killCorinna Vinschen2019-01-302-1/+7
| | | | | | | | | | | POSIX requires that raise(3) is equivalent to pthread_kill(pthread_self(), sig); in multi-threaded applications. Our raise just called kill(sig). Fix that. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: execve: reduce parent handle to non-inheritable SYNCHRONIZECorinna Vinschen2019-01-292-8/+25
| | | | | | | | | Keeping an inheritable handle open results in that handle being spilled over into grandchild processes, which is not desired. Duplicate original parent handle into a non-inheritable one with minimal SYNCHRONIZE permissions and close the original handle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork/exec: fix child process permissionsCorinna Vinschen2019-01-295-8/+38
| | | | | | | | | | | - Exec'ed/spawned processes don't need PROCESS_DUP_HANDLE. Remove that permission from the parent handle. - PROCESS_QUERY_LIMITED_INFORMATION doesn't work for Windows 7 if the process is started as a service. Add PROCESS_QUERY_INFORMATION for pre-Windows 8 in that case. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Makefile.in: Improve dependency for version infoCorinna Vinschen2019-01-291-1/+6
| | | | | | | | | | | | The version info only depends on the object files. This results in the version info not being rebuild immediately if a source file is changed. Rather, the version info is only rebuilt on the next make run. Fix that by making the version info build rule dependent on the source files. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: procfd: improve debug outputCorinna Vinschen2019-01-281-2/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: disable unused funcs and lsaauth subdirCorinna Vinschen2019-01-283-3/+11
| | | | | | If S4U proves to be usable alone, remove this code entirely. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: spawn: revert incorrect restriction of permissionsCorinna Vinschen2019-01-271-2/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: fork: restrict parent handle perms and drop handle after useCorinna Vinschen2019-01-273-3/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: use Kerberos/MsV1_0 S4U authentication by defaultCorinna Vinschen2019-01-268-79/+353
| | | | | | | | | | | | | - This simple and official method replaces cyglsa and "create token" methods. No network share access, same as before. - lsaauth and create_token are disabled now. If problems crop up, they can be easily reactivated. If no problems crop up, they can be removed in a while, together with the lsaauth subdir. - Bump Cygwin version to 3.0. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: uname: Raise size of utsname fields and revamp uname(2) outputCorinna Vinschen2019-01-268-7/+92
| | | | | | | | | | | | | | | | New format: sysname: CYGWIN_NT-${osversion}-${os_build_number}[-WOW64] nodename: `gethostname` release: ${cygwin_version}-${API minor}.${arch}[.snap] version: YYYY-MM-DD HH:MM UTC machine: ${arch} _GNU_SOURCE: domainname: `getdomainname` !_GNU_SOURCE: __domainname: `getdomainname` Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: netdb.h: fix __GNU_VISIBLE testsCorinna Vinschen2019-01-261-3/+3
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: create_token: Return NULL, not INVALID_HANDLE_VALUECorinna Vinschen2019-01-262-5/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: syscalls.cc: fix formattingCorinna Vinschen2019-01-261-5/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: lsaauth: Drop outdated test for loading Secur32.dllCorinna Vinschen2019-01-261-6/+0
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: work with password-less user switch as wellCorinna Vinschen2019-01-243-21/+39
| | | | | | | | | | The previous patch failed with password-less auth because in that case the return code from get_server_groups wasn't tested. Fix that. Also make sure that get_server_groups does not check if the account is disabled or locked out when just fetching the group list for initgroups or getgrouplist. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: seteuid: refuse changing uid to disabled or locked out userCorinna Vinschen2019-01-242-0/+18
| | | | | | | | | | | | So far seteuid could change uid to any existing account, given sufficient permissions of the caller. This is kind of bad since it disallows admins to refuse login to disabled or locked out accounts. Add check for the account's UF_ACCOUNTDISABLE or UF_LOCKOUT flags and don't let the user in, if one of the flags is set. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: net: unify gethostname/getdomainnameCorinna Vinschen2019-01-241-41/+36
| | | | | | | Use info from same source (GetNetworkParams). Also move getdomainname near gethostname in source. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: gethostname: fix fetching hostname from non-winsock functionCorinna Vinschen2019-01-242-1/+3
| | | | | | | | | If gethostname() fails we call GetComputerNameEx with ComputerNameDnsFullyQualified. This is wrong, gethostname should return the hostname only, not the FQDN. Fix this by calling GetComputerNameEx with ComputerNameDnsHostname. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: version: Use UTC timestamp as build timeCorinna Vinschen2019-01-241-1/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: cygthread: set thread name before calling thread funcCorinna Vinschen2019-01-232-2/+4
| | | | | | | | | When reusing a cygthread, the stub method fails to set the thread name to the new name. The name is only set when actually creating the thread. Fix that by moving the SetThreadName call right in front of the thread function call. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Use nanf() instead of nan() in single-precision float libm math functionsJozef Lawrynowicz2019-01-234-4/+4
| | | | | This patch reduces code size for a few single-precision float math functions, by using nanf() instead of nan() where required.
* Use HUGE_VALF instead of HUGE_VAL in single-precision float libm math functionsJozef Lawrynowicz2019-01-2316-18/+18
| | | | | This patch replaces instances of "(float).*HUGE_VAL" with a direct usage of HUGE_VALF, which is also defined in math.h.
* Remove HUGE_VAL definition from libm math functionsJozef Lawrynowicz2019-01-2331-186/+0
| | | | | | This patch removes the definitions of HUGE_VAL from some of the float math functions. HUGE_VAL is defined in newlib/libc/include/math.h, so it is not necessary to have a further definition in the math functions.
* Remove matherr, and SVID and X/Open math library configurationsJozef Lawrynowicz2019-01-2390-2350/+433
| | | | Default math library configuration is now IEEE
* Cygwin: posix timers: fix overrun count always being 1 too bigCorinna Vinschen2019-01-222-37/+21
| | | | | | | | | | Combine with a bit of cleanup: - Drop overrun_event_running in favor of overrun_count being -1. - Fix include guard in posix_timer.h. - Drop ununsed function timespec_to_us. - Don't use Interlocked functions without need. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: fix error handling in public APICorinna Vinschen2019-01-221-6/+15
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: allocate timer_tracker on system heap.Corinna Vinschen2019-01-223-5/+5
| | | | | | | | | Allocating on the cygheap would copy information of the tracker into the child process. A forked child knows the timer id and could simply still access the (free'd but still valid) timer_tracker on the heap, which is dangerous and very certainly doesn't reflect POSIX semantics. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARMCorinna Vinschen2019-01-223-8/+9
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: Add support for CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARMCorinna Vinschen2019-01-221-7/+6
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: clocks: Add CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM clocksCorinna Vinschen2019-01-222-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* time.h: Add CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARMCorinna Vinschen2019-01-221-8/+12
| | | | | | Slightly reshuffle and add comment Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: posix timers: reimplement using OS timerCorinna Vinschen2019-01-227-239/+289
| | | | | | | | | | | | | | | | - Rename files timer.* to posix_timer.*. - Reimplement using an OS timer rather than a handcrafted wait loop. - Use a Slim R/W Lock for synchronization. - Drop timer chaining. It doesn't server a purpose since all timers are local only. - Rename ttstart to itimer_tracker to better reflect its purpose. It's not the anchor for a timer chain anymore anyway. - Drop fixup_timers_after_fork. Everything is process-local, nothing gets inherited. - Rename timer_tracker::disarm_event to disarm_overrun_event for better readability. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: another overrun computation fix and drop useless variableCorinna Vinschen2019-01-221-6/+4
| | | | | | | | | | | | - When correcting the next expiration timestamp, the number of expirations gets computed correctly, just the expiration timestamp itself is then only incremented by a single interval, rather than the just computed expired intervals. Fix that. - drop the local clock variable in timerfd_tracker::create. It doesn't serve any purpose. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: reset expiry counter in settimeCorinna Vinschen2019-01-211-0/+1
| | | | | | As on Linux, reset the expiry counter when the timer gets rearmed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: fix gettimeCorinna Vinschen2019-01-211-7/+22
| | | | | | | | | | | | - split into to __try/__except blocks to make sure leave_critical_section is always called when required. - Actually fill time_spec in settime so it_interval is returned correctly. - Return all 0 if timer is disarmed. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: move ioctl error handling into timerfd_trackerCorinna Vinschen2019-01-213-36/+39
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: rename overrun_count to expiration_countCorinna Vinschen2019-01-213-35/+35
| | | | | | | | The value returned by reading from a timerfd is not an overrun count in the same sense as for posix timers, it's an expiry counter. Reflect that in the name. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: fix overrun computationCorinna Vinschen2019-01-211-10/+11
| | | | | | | | | | | | | - Drop erroneous initial computation of overrun count in settime for absolute non-realtime clocks. It's repeated in thread_func and thus counted twice. - Fix overrun computation for timestamp offsets being a multiple of the timer interval. The timestamp has to be corrected after the first offset, otherwise the correction loop counts the intervals again. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: settime: fix computing DueTime on non-realtime clocksCorinna Vinschen2019-01-211-1/+1
| | | | | | | Non-CLOCK_REALTIME counters always use a relative DueTime in NtSetTimer. However, relative DueTime has to be negative, but the code Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: Handle gettime error in settimeCorinna Vinschen2019-01-211-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: fill out it_interval on timerfd_gettimeCorinna Vinschen2019-01-212-0/+2
| | | | | | Might not be such a bad idea, after all... Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: implement TFD_TIMER_CANCEL_ON_SETCorinna Vinschen2019-01-203-11/+109
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: timerfd: convert expiry timestamp to LONG64Corinna Vinschen2019-01-201-4/+4
| | | | | | Turns out we never need it as LARGE_INTEGER. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>