summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of duplicates.Ruslan Ermilov2003-09-143-3/+3
| | | | Notes: svn path=/head/; revision=120054
* mdoc(7): Fix common mistakes made in the SEE ALSO section.Ruslan Ermilov2003-09-123-6/+8
| | | | Notes: svn path=/head/; revision=120010
* mdoc(7): Properly mark C headers.Ruslan Ermilov2003-09-1020-29/+29
| | | | Notes: svn path=/head/; revision=119964
* Document the fact that send(2) can return EPIPE (like when a socket is notOllivier Robert2003-09-101-0/+4
| | | | | | | | | | | connected). PR: docs/56683 Submitted by: Chris S.J. Peron <maneo@bsdpro.com> MFC after: 3 days Notes: svn path=/head/; revision=119963
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-0862-105/+105
| | | | Notes: svn path=/head/; revision=119893
* In the !MNT_BYFSID case, return EINVAL from unmount(2) when theIan Dowse2003-09-081-7/+12
| | | | | | | | | | | | | | | | | specified directory is not found in the mount list. Before the MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent path and EINVAL for a non-mountpoint, but we can no longer distinguish between these cases. Of the two error codes, EINVAL was more likely to occur in practice, and it was the only one of the two that was documented. Update the manual page to match the current behaviour. Suggested by: tjr Reviewed by: tjr Notes: svn path=/head/; revision=119885
* Clarify that the second argument to accept() may be a null pointer ifPeter Pentchev2003-09-051-1/+7
| | | | | | | | | | | | no peer address information is desired. PR: 56044 Submitted by: Felix Opatz <felix@zotteljedi.de> and Bernd Luevelsmeyer <bdluevel@heitec.net> MFC after: 1 month Notes: svn path=/head/; revision=119775
* Remove an unused and incorrect prototype for _none_init().Tim J. Robbins2003-09-051-1/+0
| | | | Notes: svn path=/head/; revision=119757
* Move a sentence about the terminating \0 from the RETURN VALUES sectionSimon L. B. Nielsen2003-09-042-14/+14
| | | | | | | | | | | (where it didn't really belong), to the DESCRIPTION section. English advice: ceri Requested by: das MFC after: 4 weeks Notes: svn path=/head/; revision=119748
* Sigh. I can't win anything. Use addq rather than addl with %rsp.Peter Wemm2003-09-041-1/+1
| | | | Notes: svn path=/head/; revision=119727
* Apply same basic fix for getcontext(2) as for i386. Store the returnPeter Wemm2003-09-042-2/+56
| | | | | | | | | value for getcontext() in a preserved register rather than on the stack. The second time around, the stack value would likely have changed so we can't depend on it for the return value. Notes: svn path=/head/; revision=119726
* Fix some minor whitespace botchesPeter Wemm2003-09-041-1/+1
| | | | Notes: svn path=/head/; revision=119725
* Make getcontext(2) work on i386. It needs a small wrapper in libcPeter Wemm2003-09-042-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | otherwise the return from the syscall stub for getcontext will pop off the return value for the caller to the getcontext stub and it will appear as though the setcontext() syscall returned instead of the getcontext(). The same bug exists on amd64, a fix is coming there too. The bug can be demonstrated with this test code fragment: main() { ucontext_t top; if (getcontext(&top) == 0) { write(2, "PING!\n", 6); /* Cause a return value of 1 from getcontext this time */ top.uc_mcontext.mc_eax = 1; setcontext(&top); err(1, "setcontext() returned"); } write(2, "PONG!\n", 6); _exit(0); } Notes: svn path=/head/; revision=119724
* Fix/add errno return values to match the NFS client implementation andDiomidis Spinellis2003-09-022-5/+16
| | | | | | | | | | | better represent failures of special files accessed over NFS. Approved by: schweikh (mentor) Reviewed by: bde (as a description) MFC after: 6 weeks Notes: svn path=/head/; revision=119688
* Update the kern.osreldate documentation to document the present formatEivind Eklund2003-09-011-2/+17
| | | | | | | | | used, and refer to <osreldate.h> to get userland date. Submitted by: ru Notes: svn path=/head/; revision=119654
* Return (-1) not (ENOENT) for mac_prepare_type(), and set errno toRobert Watson2003-08-301-1/+2
| | | | | | | | | | ENOENT instead. Reported by: "Kenneth D. Merry" <ken@kdm.org> Submitted by: Bryan Liesner <bleez@comcast.net> Notes: svn path=/head/; revision=119588
* Document that read(2) can also return EPERMDiomidis Spinellis2003-08-301-0/+3
| | | | | | | | | | | | | | | | | | | | See e.g. nfsclient/nfs_vnops.c static int nfs_read(struct vop_read_args *ap) { struct vnode *vp = ap->a_vp; if (vp->v_type != VREG) return (EPERM); return (nfs_bioread(vp, ap->a_uio, ap->a_ioflag, ap->a_cred)); } Approved by: schweikh (mentor) MFC after: 6 weeks Notes: svn path=/head/; revision=119570
* Clarify textEivind Eklund2003-08-261-1/+1
| | | | Notes: svn path=/head/; revision=119492
* Add HISTORY sections to the remaining MAC library man pages.Robert Watson2003-08-226-0/+36
| | | | | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=119321
* Update the mac_prepare(3) man page to reflect changes to theRobert Watson2003-08-221-8/+43
| | | | | | | | | | | | mac_prepare() APIs. Add a HISTORY section. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=119320
* Make the elements argument to mac_prepare() be const.Robert Watson2003-08-221-1/+1
| | | | | | | | Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=119317
* As new objects begin to support new labels, start to generalizeRobert Watson2003-08-221-86/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the default label support in /etc/mac.conf. Rather than maintain each default label type in an explicit global variable in mac.c, keep a list of defaults loaded from the configuration file. Generalize the parsing so that we support both the older: default_file_labels foo default_ifnet_labels foo default_process_labels foo And also a new: default_labels file foo default_labels ifnet foo default_labels process foo We now accept arbitrary object classes in the first argument. If the same object is specified more than once, we discard the earlier definition in favor of the later one. Add a new API, mac_prepare_type(), which accepts a mac_t to prepare, as well as an object name in the second argument, which will pull a default label set for the object out of the configuration loaded by mac_init_internal(). This permits the libc to adapt to new objects known about by applications but not by libc at compile-time. Also liberalize the error handling a bit: if we're using implicit initialization (i.e., the application didn't explicitly initialize the MAC code), ignore syntax errors and only use valid lines. In the future, we may want to add explicit warnings and do this a bit more consistently. While here, add support for a MAC_CONFFILE environmental variable, which may be used to specify an alternative mac.conf configuration file if the application isn't running with modified privilege (issetugid()). Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=119314
* Add a kluge suggested by Marcel to paper over the difference betweenGarrett Wollman2003-08-192-0/+4
| | | | | | | | | | | | | | | gethostname()'s old and new signatures without requiring a library bump. Note that programs which called gethostname() with a negative argument were already broken, since the same type conversion was done by the old implementation. Add a note in the Makefile so that whoever next bumps the libc revision will delete the kluge at the same time (as it will no longer be necessary). This is only operative on 64-bit platforms. Submitted by: marcel Notes: svn path=/head/; revision=119151
* Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEMGarrett Wollman2003-08-192-18/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when the buffer is not long enough to hold the current host name. POSIX does not standardize error returns for gethostname(), so it doesn't matter which one we use, but ENAMETOOLONG is at least a little more intuitive, and mi suggests the existence of prior art. I've been running with this change for a while on my home machine with no effect. At the same time, I've updated the prototype for gethostname() to use the correct standard type (size_t) for the namelen argument. All of the in-tree callers fall into one of the following categories: 1) Call perror() or equivalent when gethostname() fails. 2) Ignore gethostname()'s return value entirely, potentially resulting in data corruption if the buffer is too small. 3) Fall back to a (possibly sensible) default value if gethostname() fails. Many of the callers I examined shows signs of confusion about the correct sizing of the host name buffer. gethostname(3) now has more information about this, as well as updated standards information. PR: 48114 Submitted by: mi (in part) Notes: svn path=/head/; revision=119140
* style.Makefile(5)David E. O'Brien2003-08-181-1/+1
| | | | Notes: svn path=/head/; revision=119071
* Stage 3 of dynamic root support. Make all the libraries needed to runGordon Tetlow2003-08-171-0/+1
| | | | | | | | | binaries in /bin and /sbin installed in /lib. Only the versioned files reside in /lib, the .so symlink continues to live /usr/lib so the toolchain doesn't need to be modified. Notes: svn path=/head/; revision=119017
* Fix wrong identifier on .end directive. The SYSCALL macro does nameMarcel Moolenaar2003-08-164-4/+4
| | | | | | | mangling and creates an .ent directive with the mangled name. Notes: svn path=/head/; revision=118997
* Replace some syscalls with libc version, this makes abort work better withDavid Xu2003-08-161-10/+7
| | | | | | | | | libkse. Tested under libc_r, libkse, libthr. Reviewed by: deischen Notes: svn path=/head/; revision=118988
* Make the documentation of PT_STEP match its implementation: theIan Dowse2003-08-111-2/+3
| | | | | | | | | | `data' parameter is not ignored; if non-zero, it specifies a signal number to be delivered to the traced process. MFC after: 1 day Notes: svn path=/head/; revision=118780
* Add the mlockall()/munlockall() system call manual page from NetBSD.Bruce M Simpson2003-08-111-0/+140
| | | | | | | | | | | PR: kern/42426, standards/54223 Obtained from: NetBSD Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=118773
* Add the mlockall() and munlockall() system calls.Bruce M Simpson2003-08-117-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | - All those diffs to syscalls.master for each architecture *are* necessary. This needed clarification; the stub code generation for mlockall() was disabled, which would prevent applications from linking to this API (suggested by mux) - Giant has been quoshed. It is no longer held by the code, as the required locking has been pushed down within vm_map.c. - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES to express their intention explicitly. - Inspected at the vmstat, top and vm pager sysctl stats level. Paging-in activity is occurring correctly, using a test harness. - The RES size for a process may appear to be greater than its SIZE. This is believed to be due to mappings of the same shared library page being wired twice. Further exploration is needed. - Believed to back out of allocations and locks correctly (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC). PR: kern/43426, standards/54223 Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=118771
* For type 0 rng lower initial drop to 50, it is enough to hide linearityAndrey A. Chernov2003-08-101-1/+5
| | | | | | | Reorganize historic #ifdef section Notes: svn path=/head/; revision=118731
* Fix the case of the encoding name in the ENCODING line. Names areTim J. Robbins2003-08-101-1/+1
| | | | | | | case-sensitive, and MSKANJI does not work. Notes: svn path=/head/; revision=118726
* Cross-reference gbk(5).Tim J. Robbins2003-08-101-0/+1
| | | | Notes: svn path=/head/; revision=118725
* Cross-reference gbk(5) now that it exists. Fix a copy & paste error:Tim J. Robbins2003-08-101-1/+2
| | | | | | | one occurrence of GB 18030 should have been 11383. Notes: svn path=/head/; revision=118723
* Add a fairly minimal manual page for the GBK encoding.Tim J. Robbins2003-08-102-1/+63
| | | | Notes: svn path=/head/; revision=118722
* Add a cross reference to Unicode 3.0.Tim J. Robbins2003-08-101-1/+6
| | | | Notes: svn path=/head/; revision=118721
* Add cross references to the new character encoding manual pages,Tim J. Robbins2003-08-101-1/+5
| | | | | | | and to mbsinit(3) while I'm at it. Notes: svn path=/head/; revision=118719
* Add manual pages for the BIG5, GB18030 and MSKanji encodings. These mayTim J. Robbins2003-08-104-1/+189
| | | | | | | need to be fleshed out a little, especially big5(5). Notes: svn path=/head/; revision=118718
* o There are 6 trap disable bits in ar.fpsr, not five. Even though weMarcel Moolenaar2003-08-092-4/+4
| | | | | | | | | | | | | | | | didn't provide a constant for one of them (non-IEEE denormal trap), in an attempt to not support it probably, it's not we are left with the lower 5 bits. o Properly mask the passed or returned fp_except_t. Not doing so causes instant core dumps by trying to write an invalid value to ar.fpsr. Now that we're masking, stop using exclusive-or to invert bits. This fixes the illegal instruction fault encountered when building mozilla. Notes: svn path=/head/; revision=118696
* Add signalcontext() which will be needed by libpthread.Daniel Eischen2003-08-092-1/+104
| | | | | | | Reviewed by: marcel Notes: svn path=/head/; revision=118687
* Add the POSIX 1003.1-2001 posix_madvise() interface.Bruce M Simpson2003-08-094-4/+29
| | | | | | | | | PR: standards/54634 Reviewed by: das Approved by: jake (mentor) Notes: svn path=/head/; revision=118684
* Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't validMarcel Moolenaar2003-08-088-8/+0
| | | | | | | anymore. This also fixes long line bugs caused by the lengthy URLs :-) Notes: svn path=/head/; revision=118670
* Fix markup for uuid_equal()Marcel Moolenaar2003-08-081-1/+2
| | | | Notes: svn path=/head/; revision=118669
* Fix two (2) bugs in one (1) statement:Marcel Moolenaar2003-08-081-1/+4
| | | | | | | | | | | | | | | | o fix the len argument of memcmp(3) to be the size of the node field of the uuid structure, not the size of the uuid structure itself. We're comparing the node fields... o uuid_compare(3) is specified to return -1, 0 or 1, depending on the outcome of the comparison. memcmp(3) returns the difference between the first differing bytes. Hence, we cannot ever return the return value of memcmp(3) as-is. PR: standards/55370 Submitted by: Konstantin Oznobihin <bork@rsu.ru> Notes: svn path=/head/; revision=118668
* Implement signalcontext.Jake Burkholder2003-08-082-2/+78
| | | | Notes: svn path=/head/; revision=118655
* Implement mblen(s, n) as mbtowc(NULL, s, n) to avoid calling sgetrune()Tim J. Robbins2003-08-071-26/+9
| | | | | | | | and to simplify things. This is only valid until we start supporting state-dependent encodings. Notes: svn path=/head/; revision=118595
* Implement mbstowcs() as a wrapper around mbsrtowcs(), and wcstombs()Tim J. Robbins2003-08-072-115/+24
| | | | | | | as a wrapper around wcsrtombs(). Notes: svn path=/head/; revision=118593
* Implement mbtowc() in terms of mbrtowc(), and wctomb() in terms of wcrtomb().Tim J. Robbins2003-08-072-53/+42
| | | | Notes: svn path=/head/; revision=118591
* Implement btowc() in terms of mbrtowc() instead of sgetrune(), andTim J. Robbins2003-08-072-10/+27
| | | | | | | | | | | | wctob() in terms of wcrtomb() instead of sputrune(). There should be no functional differences, but there may be a small performance hit because we make an extra function call. The aim here is to have as few functions as possible calling s{get,put}rune() to make it easier to remove them in the future. Notes: svn path=/head/; revision=118589