Commit Graph

6753 Commits

Author SHA1 Message Date
Ed Schouten
126b6df920 Make utmpx(3) thread safe if we support TLS.
Because the utmpx interface is generally not required to be thread-safe,
but it is nice to have, if easy to do so. Therefore don't make a mess
out of the code and only use it if __NO_TLS is not defined.
2012-03-23 08:26:31 +00:00
Sergey Kandaurov
3daaaabdb8 Fix style. Somehow I managed to lost a space when copy&paste.
Pointed out by:	stefanf
2012-03-22 09:51:31 +00:00
Sergey Kandaurov
130b343048 Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5
when passing damaged user-supplied fstab file data.

MFC after:	1 week
2012-03-22 09:42:27 +00:00
David Xu
4e2158bf53 Revert previous change. It is an incomplete change from old branch. :-( 2012-03-21 07:16:58 +00:00
David Xu
cc583082f4 Use version 2 of semaphore provided by kernel umtx code, now if there is
no waiters, we still increase and decrease count in user mode without
entering kernel, once there is a waiter, sem_post will enter kernel to
increase count and wake thread up, this is atomicy and allow us to
gracefully destroy semaphore after sem_wait returned.
2012-03-21 07:12:52 +00:00
David Chisnall
5a674eeb8f Make __get_locale() static inline, not just inline, so when compiling libc in
debug mode (without optimisations) it doesn't generate a linker failure.

Approved by:	dim (mentor)
2012-03-19 11:47:37 +00:00
Benjamin Kaduk
87696ecec7 Remove trailing whitespace.
Approved by:	hrs (mentor)
2012-03-19 05:08:09 +00:00
Benjamin Kaduk
8882458c89 Expound a bit more about the system maximum number of FIBs,
how it may be set, and current limitations on the value.

Approved by:	hrs (mentor)
PR:		docs/157453
MFC after:	1 week
2012-03-19 04:46:11 +00:00
Eitan Adler
6210106152 draft-ietf-ipv6-scoping-arch-02.txt is now RFC 4007
PR:		docs/163771
Submitted by:	phk
Reviewed by:	If someone else reviewed your modification.
Approved by:	cperciva
MFC after:	1 week
2012-03-19 00:47:01 +00:00
Jilles Tjoelker
012df2856c fts(3): Mention that FTS_NOCHDIR imposes {PATH_MAX} limits on the returned
pathnames.

With the current API (no *at functions), FTS_NOCHDIR requires that the
fts_accpath start with the original path passed to fts_open(); therefore,
the depth that can be reached is limited by the {PATH_MAX} constraint on
this pathname.

MFC after:	1 week
2012-03-18 21:46:27 +00:00
Jilles Tjoelker
145c674dbd fts(3): Document cases where FTS_NOCHDIR is set implicitly.
PR:		docs/166091
Submitted by:	Matthew Story
MFC after:	1 week
2012-03-18 20:34:01 +00:00
Oleksandr Tymoshenko
61ad92ef03 Unbreak trhe build by including proper header 2012-03-18 08:08:06 +00:00
Oleksandr Tymoshenko
7dc77cabb9 Fix TLS for statically linked binaries
Approved by:	cognet
2012-03-18 03:42:54 +00:00
Konstantin Belousov
1d73bec4c1 Do not claim that msync(2) is obsoleted [1].
Document EIO from msync(2).

Inspired by PR:	 docs/165929 [1]
Reviewed by:	 jilles
MFC after:	 2 weeks
2012-03-17 23:55:18 +00:00
Ed Schouten
effed41a0b Remove non-existing error condition.
Just like kill(2), it is impossible for killpg(0, ...) to fail with
ESRCH, as a process always has a process group.

Discussed on:	arch@
MFC after:	1 week
2012-03-15 21:19:50 +00:00
Ed Schouten
e06ea46468 Extend the description for ESRCH a bit.
This errno can also be returned if the passed process identifier doesn't
correspond with a process group.

Discussed on:	arch@
MFC after:	1 week
2012-03-15 12:12:39 +00:00
Ed Schouten
c0fd04a922 Remove impossible error condition from the man page.
On FreeBSD, all processes have a process group, so it is impossible for
kill(2) to fail this way.  POSIX also doesn't mention this error
condition.

Discussed on:	arch@
MFC after:	3 weeks
2012-03-15 11:49:26 +00:00
Konstantin Belousov
a9e7383c18 Fix indentation.
MFC after:	3 days
2012-03-14 15:30:59 +00:00
David Chisnall
c889dd01b9 First set of xlocale man pages. More to follow...
Approved by:	dim (mentor)
2012-03-13 20:02:41 +00:00
David Chisnall
4d7815ecc4 More xlocale cleanups.
Approved by:	dim (mentor)
2012-03-13 14:14:13 +00:00
Edward Tomasz Napierala
6975edd9d0 Cross-reference sigqueue(2) and kill(2). 2012-03-10 10:54:52 +00:00
Dimitry Andric
cc09dfac61 Fix build of libc.so after r232620. This caused a duplicate definition
of __getCurrentRuneLocale().

Pointy hat to:	me
2012-03-06 21:56:30 +00:00
David Chisnall
7dfd88318b Remove some duplicated copyright notices.
Approved by:	dim (mentor)
2012-03-06 12:53:44 +00:00
Oleksandr Tymoshenko
54da2fb8f2 - Switch ARM and MIPS to TLS Variant I
- Fix TLS allocation  for Variant I: both rtld and libc allocators
    assume that tls_static_space includes space for TLS structure.
    So increment calculated static size by the size of it.
2012-03-06 03:42:54 +00:00
Oleksandr Tymoshenko
011caac286 Implement _set_tp 2012-03-06 03:30:09 +00:00
Pawel Jakub Dawidek
cc83460ceb Link EV_SET(3) to kqueue(2).
MFC after:	3 days
2012-03-05 20:59:34 +00:00
Eitan Adler
a8448a8ce7 Remove outdated comment of seven years
PR:		docs/116116
Approved by:	cperciva
MFC after:	1 week
2012-03-04 16:44:04 +00:00
Eitan Adler
008474bbf1 Remove reference to gcc's non-standard -fwritable-strings, which
doesn't exist in recent releases (and is bad advice anyway)

PR:		docs/163119
Submitted by:	Yuri Pankov <yuri.pankov@gmail.com>
Approved by:	cperciva
MFC after:	1 week
2012-03-04 16:41:07 +00:00
Eitan Adler
0a0c8e010d POSIX mandates that swab do nothing when len < 0
PR:		kern/140690
Submitted by:	Jeremy Huddleston <jeremyhu@apple.com>
Approved by:	cperciva
MFC after:	2 weeks
2012-03-04 16:39:08 +00:00
David Chisnall
a8ed63bb3d Reapply 227753 (xlocale cleanup), plus some fixes so that it passes build
universe with gcc.

Approved by:	dim (mentor)
2012-03-04 15:31:13 +00:00
Olivier Houchard
2dee026843 Add __aeabi_read_tp to the symbol list. 2012-03-04 15:25:11 +00:00
Ruslan Ermilov
e5fb99b712 Removed excessive _seekdir() call in closedir(). This saves one lseek()
syscall.  Before r5958, seekdir() was called for its side effect of
freeing memory allocated by opendir() for rewinddir(), but that revision
added _reclaim_telldir() that frees all memory allocated by telldir()
calls, making this call redundant.

This introduces a slight change.  If an application duplicated the descriptor
obtained through dirfd(), it can no longer rely on file position to be
reset to the start of file after a call to closedir().  It's believed to
be safe because neither POSIX, nor any other OS I've tested (NetBSD, Linux,
OS X) rewind the file offset pointer on closedir().

Reported by:	Igor Sysoev
2012-03-02 14:05:50 +00:00
Konstantin Belousov
2cfd3f86b0 Belatedly add dl_iterate_phdr(3) to the list of installed manpages.
MFC after:	3 days
2012-03-02 13:19:56 +00:00
Ruslan Ermilov
01e4939740 Finally removed the stat() and fstat() calls from the opendir() code.
They were made excessive in r205424 by opening with O_DIRECTORY.
Also eliminated the fcntl() call used to set FD_CLOEXEC by opening
with O_CLOEXEC.

(fdopendir() still checks that the passed descriptor is a directory,
and sets FD_CLOEXEC on it.)

Reviewed by:	ed
2012-03-02 10:03:38 +00:00
Andrey V. Elsukov
1d73388a07 Note that memory should be freed after uuid_to_string(3) call.
MFC after:	1 week
2012-03-01 14:39:01 +00:00
Konstantin Belousov
1d2ea43149 Document SO_PROTOCOL socket option.
Discussed with:	bz
Reviewed by:	glebius
MFC after:	2 weeks
2012-02-26 13:57:24 +00:00
Glen Barber
9d496f5ab6 Whitespace cleanup:
o Wrap sentences on to new lines
 o Cleanup trailing whitespace

Found with:	textproc/igor
MFC after:	1 week
X-MFC-With:	r232157
2012-02-25 15:21:43 +00:00
Glen Barber
3102cfe2e2 Fix various typos in manual pages.
Submitted by:	amdmi3
PR:		165431
MFC after:	1 week
2012-02-25 14:31:25 +00:00
David Xu
df1f1bae9e In revision 231989, we pass a 16-bit clock ID into kernel, however
according to POSIX document, the clock ID may be dynamically allocated,
it unlikely will be in 64K forever. To make it future compatible, we
pack all timeout information into a new structure called _umtx_time, and
use fourth argument as a size indication, a zero means it is old code
using timespec as timeout value, but the new structure also includes flags
and a clock ID, so the size argument is different than before, and it is
non-zero. With this change, it is possible that a thread can sleep
on any supported clock, though current kernel code does not have such a
POSIX clock driver system.
2012-02-25 02:12:17 +00:00
Jilles Tjoelker
8b34578da7 libc: Eliminate some relative relocations in fmtmsg(). 2012-02-22 21:47:50 +00:00
Pawel Jakub Dawidek
57a82ba4d9 Document the fact that getgrouplist(3) returns 0 on success.
MFC after:	3 days
2012-02-20 20:46:27 +00:00
Konstantin Belousov
3e2f30f6dd Document PL_FLAG_CHILD.
MFC after:	3 days
2012-02-18 22:26:32 +00:00
Xin LI
3a12c0461b Use ANSI prototypes. 2012-02-18 00:55:54 +00:00
Konstantin Belousov
1c90f07c45 Fix cross-references.
Submitted by:	pluknet
MFC after:  2 weeks
2012-02-17 12:40:27 +00:00
Konstantin Belousov
ab8f652cd7 Document dl_iterate_phdr(3).
Man page is based on the OpenBSD version, extended and corrected for
the FreeBSD implementation.

MFC after:  2 weeks
2012-02-17 10:51:40 +00:00
Konstantin Belousov
a7d61fc17d Fetch the aux vector for the static libc, and use the entries to
initialize the cache of the system information as it was done for the
dynamic libc. This removes several sysctls from the static binary
startup.

Use the aux vector to fill the single struct dl_phdr_info describing
the static binary itself, to implement dl_iterate_phdr(3) for the
static binaries. [1]

Based on the submission by:	John Marino <draco marino st> [1]
Tested by:   flo (sparc64)
MFC after:	2 weeks
2012-02-17 10:49:29 +00:00
Eitan Adler
9d4261b795 Add err(3) to strerror(3) SEE ALSO section
PR:		docs/164940
Submitted by:	Niclas Zeising <zeising@daemonic.se>
Approved by:	cperciva
MFC after:	3 days
2012-02-16 05:06:07 +00:00
Xin LI
601e0f587d Bump .Dd date for previous revision. 2012-02-15 18:34:57 +00:00
David Xu
03a67b59f8 Add notes about sigev_notify_kevent_flags introduced in revision 230857
which enables thread-friendly polling on same fd for AIO events.

Reviewed by:	delphij
2012-02-15 02:59:17 +00:00
Dimitry Andric
b74cf6dcf1 Revert r231673 and r231682 for now, until we can run a full make
universe with them.  Sorry for the breakage.

Pointy hat to:	     me and brooks
2012-02-14 21:48:46 +00:00