Commit Graph

4178 Commits

Author SHA1 Message Date
Eivind Eklund
62d6317d5a Update the kern.osreldate documentation to document the present format
used, and refer to <osreldate.h> to get userland date.

Submitted by:	ru
2003-09-01 14:26:33 +00:00
Robert Watson
7ea02dcd89 Return (-1) not (ENOENT) for mac_prepare_type(), and set errno to
ENOENT instead.

Reported by:	"Kenneth D. Merry" <ken@kdm.org>
Submitted by:	Bryan Liesner <bleez@comcast.net>
2003-08-30 14:51:01 +00:00
Diomidis Spinellis
66eb91c1e0 Document that read(2) can also return EPERM
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
2003-08-30 07:59:05 +00:00
Eivind Eklund
09a759d347 Clarify text 2003-08-26 15:52:47 +00:00
Robert Watson
09a7f4484d Add HISTORY sections to the remaining MAC library man pages.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-08-22 18:01:03 +00:00
Robert Watson
bec8c3f9c3 Update the mac_prepare(3) man page to reflect changes to the
mac_prepare() APIs.

Add a HISTORY section.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-08-22 17:58:38 +00:00
Robert Watson
930d4ffa56 Make the elements argument to mac_prepare() be const.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-08-22 17:49:59 +00:00
Robert Watson
738824ad6c As new objects begin to support new labels, start to generalize
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
2003-08-22 17:36:23 +00:00
Garrett Wollman
89a26fd1fc Add a kluge suggested by Marcel to paper over the difference between
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
2003-08-19 23:01:46 +00:00
Garrett Wollman
effcb5eca3 Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEM
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)
2003-08-19 20:38:44 +00:00
David E. O'Brien
4f4a104ee8 style.Makefile(5) 2003-08-18 15:25:39 +00:00
Gordon Tetlow
41d8423f71 Stage 3 of dynamic root support. Make all the libraries needed to run
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.
2003-08-17 08:28:46 +00:00
Marcel Moolenaar
d4c89eb0a1 Fix wrong identifier on .end directive. The SYSCALL macro does name
mangling and creates an .ent directive with the mangled name.
2003-08-16 18:59:08 +00:00
David Xu
1d29b48683 Replace some syscalls with libc version, this makes abort work better with
libkse. Tested under libc_r, libkse, libthr.

Reviewed by: deischen
2003-08-16 11:43:57 +00:00
Ian Dowse
8a16327d58 Make the documentation of PT_STEP match its implementation: the
`data' parameter is not ignored; if non-zero, it specifies a signal
number to be delivered to the traced process.

MFC after:	1 day
2003-08-11 13:13:46 +00:00
Bruce M Simpson
a57b72b4b9 Add the mlockall()/munlockall() system call manual page from NetBSD.
PR:		kern/42426, standards/54223
Obtained from:	NetBSD
Reviewed by:	jake, alc
Approved by:	jake (mentor)
MFC after:	2 weeks
2003-08-11 07:16:21 +00:00
Bruce M Simpson
abd498aa71 Add the mlockall() and munlockall() system calls.
- 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
2003-08-11 07:14:08 +00:00
Andrey A. Chernov
40220dde01 For type 0 rng lower initial drop to 50, it is enough to hide linearity
Reorganize historic #ifdef section
2003-08-10 17:49:55 +00:00
Tim J. Robbins
e43ffa4159 Fix the case of the encoding name in the ENCODING line. Names are
case-sensitive, and MSKANJI does not work.
2003-08-10 11:41:38 +00:00
Tim J. Robbins
dcb2df4c22 Cross-reference gbk(5). 2003-08-10 11:38:28 +00:00
Tim J. Robbins
dd5e8fdef8 Cross-reference gbk(5) now that it exists. Fix a copy & paste error:
one occurrence of GB 18030 should have been 11383.
2003-08-10 11:36:42 +00:00
Tim J. Robbins
f6d8a447d1 Add a fairly minimal manual page for the GBK encoding. 2003-08-10 11:34:35 +00:00
Tim J. Robbins
9e09ac8597 Add a cross reference to Unicode 3.0. 2003-08-10 11:26:18 +00:00
Tim J. Robbins
39e2a81e3f Add cross references to the new character encoding manual pages,
and to mbsinit(3) while I'm at it.
2003-08-10 09:25:52 +00:00
Tim J. Robbins
8ca5fa518c Add manual pages for the BIG5, GB18030 and MSKanji encodings. These may
need to be fleshed out a little, especially big5(5).
2003-08-10 09:23:51 +00:00
Marcel Moolenaar
03bab8d60f o There are 6 trap disable bits in ar.fpsr, not five. Even though we
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.
2003-08-09 17:07:24 +00:00
Daniel Eischen
df2edfa20a Add signalcontext() which will be needed by libpthread.
Reviewed by:	marcel
2003-08-09 05:37:54 +00:00
Bruce M Simpson
662d85d6a2 Add the POSIX 1003.1-2001 posix_madvise() interface.
PR:		standards/54634
Reviewed by:	das
Approved by:	jake (mentor)
2003-08-09 03:23:24 +00:00
Marcel Moolenaar
10b35e00c9 Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid
anymore. This also fixes long line bugs caused by the lengthy URLs :-)
2003-08-08 19:18:43 +00:00
Marcel Moolenaar
38e35b968e Fix markup for uuid_equal() 2003-08-08 19:12:28 +00:00
Marcel Moolenaar
3031a4311e Fix two (2) bugs in one (1) statement:
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>
2003-08-08 19:03:37 +00:00
Jake Burkholder
b551cb80d4 Implement signalcontext. 2003-08-08 15:40:28 +00:00
Tim J. Robbins
b85aa4e3f7 Implement mblen(s, n) as mbtowc(NULL, s, n) to avoid calling sgetrune()
and to simplify things. This is only valid until we start supporting
state-dependent encodings.
2003-08-07 09:34:51 +00:00
Tim J. Robbins
b69a98d6d3 Implement mbstowcs() as a wrapper around mbsrtowcs(), and wcstombs()
as a wrapper around wcsrtombs().
2003-08-07 08:04:01 +00:00
Tim J. Robbins
998e124837 Implement mbtowc() in terms of mbrtowc(), and wctomb() in terms of wcrtomb(). 2003-08-07 07:59:36 +00:00
Tim J. Robbins
dab4fca49b Implement btowc() in terms of mbrtowc() instead of sgetrune(), and
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.
2003-08-07 07:45:35 +00:00
Yaroslav Tykhiy
92a9c0bd86 Document that connect(2) can return EINTR, and that it
can return EALREADY for a socket in blocking mode as well.
2003-08-06 14:21:06 +00:00
John-Mark Gurney
95aab9cc49 add support for using kqueue to watch bpf sockets.
Submitted by:	Brian Buchanan of nCircle, Inc.
Tested on:	i386 and sparc64
2003-08-05 07:12:49 +00:00
Julian Elischer
5774db75bd Allow foot shooting as Linux emulation needs it.
Also change "Auto mode" to use a "special" value
instead of 0, and define and document it.
I had thought libpthread had already been switched to use auto mode but
it appears that patch hasn't been committed yet.

Discussed with:	 Davidxu
2003-08-04 19:11:56 +00:00
Andrey A. Chernov
a9d25ab17f Restore including of "collate.h", for its own prototype (mis)match detection 2003-08-03 19:28:23 +00:00
Andrey A. Chernov
8841d0081c Remove commented out and never used code 2003-08-03 05:20:31 +00:00
Andrey A. Chernov
17f67afe28 Remove __collate_range_cmp() stabilization, it conflicts with ranges 2003-08-03 04:40:40 +00:00
Marcel Moolenaar
8955f59879 Override the default stubs for getcontext(2) and swapcontext(2) so
that we can flush the register stack prior to entering the kernel.
This avoids having dirty registers and saves us from having to
manually write them to the backing store from within the kernel.
In that respect, flushing the RSE is both functionally required as
well as performance optimal.

On average we had 18 dirty registers when getcontext(2) was called
from libthr. Since libthr does not switch back to a context created
by getcontext(2), not having dealt with the dirty registers was
harmless.
2003-08-02 00:49:36 +00:00
Marcel Moolenaar
6e9a9b9f52 The END() must expand to the .endp directive with the same name as
on the corresponding .proc directive, or the .endp must not have a
name at all.
While here, remove an artificial dependency in Ovfork.S by performing
manual register renaming.
2003-08-01 22:17:12 +00:00
David Schultz
e02cc8e419 Cross-reference arc4random(3). 2003-07-31 06:18:34 +00:00
David Schultz
05e1bf3461 The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1. 2003-07-31 06:18:24 +00:00
David Xu
01724ec53d Update manual for i386_set_ldt to reflect newly added features.
Submitted by: julian
2003-07-31 02:13:48 +00:00
Marcel Moolenaar
2cd199ce21 Only allow trapframe formats instead of sigframe formats like the
comment says and don't write the first 3 arguments to FRAME_TRAPARG_*
as they are specific to sigframes.
2003-07-30 06:36:20 +00:00
Poul-Henning Kamp
df6989b848 Minor constification. 2003-07-29 11:16:14 +00:00
Andrey A. Chernov
a03081087c Add support for gb18030 encoding
PR:             51729
Submitted by:   Kang Liu <liukang@bjpu.edu.cn>
2003-07-29 07:52:44 +00:00