Commit Graph

1333 Commits

Author SHA1 Message Date
David Schultz
00a32d0ca9 In getttyent(3), if /etc/ttys doesn't end in a newline, don't
freak out and keep trying to expand the buffer until realloc()
fails.

PR:	114398
2008-01-15 06:50:50 +00:00
John Baldwin
ce309a2f26 Add a feature_present(3) function which checks to see if a named kernel
feature is present by checking the kern.features sysctl MIB.

MFC after:	1 week
2008-01-10 22:11:21 +00:00
John Baldwin
8e38aeff17 Add a new file descriptor type for IPC shared memory objects and use it to
implement shm_open(2) and shm_unlink(2) in the kernel:
- Each shared memory file descriptor is associated with a swap-backed vm
  object which provides the backing store.  Each descriptor starts off with
  a size of zero, but the size can be altered via ftruncate(2).  The shared
  memory file descriptors also support fstat(2).  read(2), write(2),
  ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared
  memory file descriptors.
- shm_open(2) and shm_unlink(2) are now implemented as system calls that
  manage shared memory file descriptors.  The virtual namespace that maps
  pathnames to shared memory file descriptors is implemented as a hash
  table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash
  of the pathname.
- As an extension, the constant 'SHM_ANON' may be specified in place of the
  path argument to shm_open(2).  In this case, an unnamed shared memory
  file descriptor will be created similar to the IPC_PRIVATE key for
  shmget(2).  Note that the shared memory object can still be shared among
  processes by sharing the file descriptor via fork(2) or sendmsg(2), but
  it is unnamed.  This effectively serves to implement the getmemfd() idea
  bandied about the lists several times over the years.
- The backing store for shared memory file descriptors are garbage
  collected when they are not referenced by any open file descriptors or
  the shm_open(2) virtual namespace.

Submitted by:	dillon, peter (previous versions)
Submitted by:	rwatson (I based this on his version)
Reviewed by:	alc (suggested converting getmemfd() to shm_open())
2008-01-08 21:58:16 +00:00
John Baldwin
6457bae568 Fix a typo in regards to the ENOENT error.
PR:		docs/118929
Submitted by:	mymtom of hotmail
MFC after:	3 days
2007-12-27 21:55:49 +00:00
Michael Bushkov
a59d6a8724 Implementing 'fallback' nsswitch source. 'fallback' source is used
when particular function can't be found in nsswitch-module. For
example, getgrouplist(3) will use module-supplied 'getgroupmembership'
function (which can work in an optimal way for such source as LDAP) and
will fall back to the stanard iterate-through-all-groups implementation
otherwise.

PR:		ports/114655
Submitted by:	Michael Hanselmann <freebsd AT hansmi DOT ch>
Reviewed by:	brooks (mentor)
2007-12-12 10:08:03 +00:00
Dag-Erling Smørgrav
4a95df55c3 Since jb@ fixed the type of dd_lock in <dirent.h>, these casts are no
longer required.
2007-12-03 14:33:51 +00:00
Jason Evans
0f7362f417 Add _pthread_mutex_init_calloc_cb to libc's map, for which malloc defines
a stub.
2007-11-27 16:22:21 +00:00
Olivier Houchard
e93073b33d Change the casts from (pthread_mutex_t *) to (void *) to keep gcc quiet.
Anybody with a cleaner solution feel free to change it.
2007-11-19 21:57:28 +00:00
Giorgos Keramidas
aada4cf330 Remove extraneous .Ef request.
MFC after:	3 days
2007-10-30 15:26:20 +00:00
Ruslan Ermilov
3be18423c1 VM_METER is long deprecated. 2007-10-16 11:29:13 +00:00
Ruslan Ermilov
bef19503d5 Rescue parts of the sensorsd commit that are still relevant:
- HW_FLOATINGPOINT renamed to HW_FLOATINGPT.
- Documented HW_REALMEM.
- Sorted as per <sys/sysctl.h>.
2007-10-16 11:22:58 +00:00
Alexander Leidinger
9f05d312b3 Backout sensors framework.
Requested by:	phk
Discussed on:	cvs-all
2007-10-15 20:00:24 +00:00
Ruslan Ermilov
f85070adef Fix mdoc in last commit. 2007-10-14 18:57:32 +00:00
Alexander Leidinger
99f6b270e3 Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components:

 * sample configuration file for sensorsd
 * rc(8) script and glue code for sensorsd(8)
 * sysctl(3) doc fixes for CTL_HW tree
 * sysctl(3) documentation for hardware sensors
 * sysctl(8) documentation for hardware sensors
 * support for the sensor structure for sysctl(8)
 * rc.conf(5) documentation for starting sensorsd(8)
 * sensor_attach(9) et al documentation
 * /sys/kern/kern_sensors.c
   o sensor_attach(9) API for drivers to register ksensors
   o sensor_task_register(9) API for the update task
   o sysctl(3) glue code
   o hw.sensors shadow tree for sysctl(8) internal magic
 * <sys/sensors.h>
 * HW_SENSORS definition for <sys/sysctl.h>
 * sensors display for systat(1), including documentation
 * sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and  -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by:	Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by:	Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by:	syrinx
Tested by:	many
OKed by:	kensmith
Obtained from:	OpenBSD (parts)
2007-10-14 10:45:31 +00:00
Sean Farley
18dc9aca2b Add fts_set_clientptr(3), fts_get_clientptr(3) and fts_get_stream(3) man
page links to fts(3).

Approved by:	wes
Approved by:	re (hrs)
MFC after:	5 days
2007-09-28 02:22:56 +00:00
Peter Wemm
4dd719bd7f Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate to
call the pad-less versions of the corresponding syscalls if the running
kernel supports it.  Check kern.osreldate once per program and cache the
result to select the appropriate syscall.  This maintains userland
compatability with kernel.old's from quite a while back.

Approved by:  re (kensmith)
2007-07-04 23:27:38 +00:00
Daniel Eischen
2665faf497 Some libc symbol map cleanups.
net: endhostdnsent is named _endhostdnsent and is
  private to netdb family of functions.

  posix1e: acl_size.c has been never compiled in,
  so there's no "acl_size".

  rpc: "getnetid" is a static function.

  stdtime: "gtime" is #ifdef'ed out in the source.

  some symbols are specific only to some architectures,
  e.g., ___tls_get_addr is only defined on i386.

  __htonl, __htons, __ntohl and __ntohs are no longer
  functions, they are now (internal) defines in
  <machine/endian.h>.

Submitted by:	ru
2007-05-31 13:01:34 +00:00
Xin LI
cb4e06eba8 ANSIfy function definitions, reduces diff against OpenBSD. 2007-05-25 10:40:33 +00:00
Daniel Eischen
5f864214bb Use C comments since we now preprocess these files with CPP. 2007-04-29 14:05:22 +00:00
Pawel Jakub Dawidek
e42e8df28f Cleanup sysconf(3) a bit. sysconf(3) assumes in some places it operates
on int, but in fact it should operate on long.
- Introduce 'lvalue' variable, which is long.
- Fix _SC_XOPEN_SHM for 64bit archs.
- Fix _SC_PHYS_PAGES for 64bit archs.
  Reported by:	simokawa
- Use lvalue for pathconf(3), as it returns long.
- Cast value explicitly to long on return.
2007-04-14 13:06:57 +00:00
Ruslan Ermilov
204542dd4c Expand the description of the host's UUID.
OK'ed by:	pjd
2007-04-10 11:19:52 +00:00
Alexander Kabaev
445eba04a8 Clean-ip TLS symbol versions. [_]__tls_get_addr function is part of
the platform ABI and as such does not belong in FBSDprivate.

__libc_tls_* functions do not have to be visible to outside world
at all.
2007-04-09 22:48:08 +00:00
Pawel Jakub Dawidek
1f13edbe4b Document KERN_HOSTUUID.
Reminded by:	ru
2007-04-09 20:21:49 +00:00
Pawel Jakub Dawidek
4e9f341722 Bump date. 2007-04-05 21:17:52 +00:00
Pawel Jakub Dawidek
f3a8d2f93c Add security.jail.mount_allowed sysctl, which allows to mount and
unmount jail-friendly file systems from within a jail.
Precisely it grants PRIV_VFS_MOUNT, PRIV_VFS_UNMOUNT and
PRIV_VFS_MOUNT_NONUSER privileges for a jailed super-user.
It is turned off by default.

A jail-friendly file system is a file system which driver registers
itself with VFCF_JAIL flag via VFS_SET(9) API.
The lsvfs(1) command can be used to see which file systems are
jail-friendly ones.

There currently no jail-friendly file systems, ZFS will be the first one.
In the future we may consider marking file systems like nullfs as
jail-friendly.

Reviewed by:	rwatson
2007-04-05 21:03:05 +00:00
Alexander Kabaev
f82d4eed2f Add entry for dl_iterate_phdr. 2007-04-03 18:38:01 +00:00
Alexander Kabaev
832a21869c Add stub for dl_iterate_phdr. 2007-04-03 18:35:20 +00:00
Jason Evans
2872a3cdfe Change macro in order to refer to FreeBSD 7.0 instead of 7.0BSD.
Reported by:	Michal Mertl <mime@traveller.cz>
2007-03-28 18:55:44 +00:00
Jason Evans
1d06bfeccf Remove some stray roff formatting that caused incorrect rendering. 2007-03-28 04:33:34 +00:00
Tim Kientzle
0031cdf4d7 Don't assert() the TLS allocation requested is big enough; just
fix the argument.

In particular, this is a step towards breaking crt1's dependence on stdio.
2007-02-25 21:23:50 +00:00
Maxim Konovalov
af48594d13 o s/cgetseq/cgetset/
Obtained from:	DragonFly
2007-02-11 18:14:49 +00:00
Peter Wemm
1fc6f17a31 Remove getobjformat() from libc's symbol map. It probably should have been
in the private area anyway.  Nothing in FreeBSD uses it any more anyway.
2007-01-25 22:36:36 +00:00
Peter Wemm
cddf85e01e Retire more remnants of a.out support, as threatened in 2002.
Laughed-at-by:  kris
2007-01-25 22:25:59 +00:00
Maxim Konovalov
ba5b74d001 o Remove duplicate includes.
Obtained from:	Slava Semushin via NetBSD
2007-01-20 08:24:02 +00:00
Warner Losh
7dcf45c07b Remove 3rd clause, renumber, ok per email 2007-01-12 07:31:30 +00:00
Warner Losh
c879ae3536 Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Warner Losh
a7e88f95bd band-aide until _SC_PHYS_PAGES actually is defined 2006-12-14 22:14:14 +00:00
Pawel Jakub Dawidek
93a8a97ce9 Add support for _SC_PHYS_PAGES, which is not standard, but can be found in
Solaris and Linux.
2006-12-14 14:32:59 +00:00
Pawel Jakub Dawidek
e5d6d64110 Document _SC_PAGESIZE. There are still 85 undocumented variables.
Obtained from:	NetBSD
2006-12-14 14:27:15 +00:00
Diomidis Spinellis
aeecffebe5 Minor clarification. 2006-12-03 19:26:17 +00:00
Maxim Konovalov
88ce725781 o As POSIX requires confstr(3) returns zero on errors, not -1.
PR:		misc/106234
Submitted by:	Guy Harris
MFC after:	1 week
2006-12-03 08:22:36 +00:00
Ruslan Ermilov
e965ede2b5 More accurately document the implementation details of internal storage.
PR:		docs/82508
2006-10-12 14:31:17 +00:00
Ruslan Ermilov
09bd310c91 Document what "msgsz" argument really denotes. [1]
Don't say that "msgsz" can be less than 0, it cannot
as it's unsigned (POSIX has the same bug).

PR:		docs/101145 [1]
MFC after:	3 days
2006-10-12 11:42:41 +00:00
Kip Macy
b84c7a797c Fix TLS on sparc64 for statically and dynamically linked binaries
Approved by: rwatson (mentor)
Reviewed by: jmg and marcel
2006-10-08 02:50:34 +00:00
Tom Rhodes
0b0ea94893 getenv.3: Put "is" on a line with other words
getobjformat.3: "takes precedence over" is not an envrionment variable.

PR:		75545
Submitted by:	n-kogane@syd.odn.ne.jp
MFC after:	3 days
2006-10-07 21:27:21 +00:00
Andrey A. Chernov
f68412f927 Automatically re-stir every 400000 calls
Obtained from:  OpenBSD
2006-10-04 01:17:23 +00:00
Ruslan Ermilov
64437d397b Markup nit. 2006-09-29 22:57:22 +00:00
Maxim Konovalov
0ba6effc8c o Don't fseek() on closed file.
Submitted by:	pgollucci@p6m7g8.com, Mark Costlow
MFC after:	3 weeks
2006-09-18 09:34:48 +00:00
Ruslan Ermilov
a73a3ab56b Markup fixes. 2006-09-17 21:27:35 +00:00
Marcel Moolenaar
9d353fbc3f Fix style(9) in code copied from rtld. 2006-09-01 17:35:48 +00:00