Commit Graph

160 Commits

Author SHA1 Message Date
christos
3c6b5224e0 avoid pointer gymnastics 2013-10-18 20:18:42 +00:00
riastradh
a7f90b2fd2 Fix races in /dev/u?random initialization and accounting.
- Push /dev/random `information-theoretic' accounting into cprng(9).
- Use percpu(9) for the per-CPU CPRNGs.
- Use atomics with correct memory barriers for lazy CPRNG creation.
- Remove /dev/random file kmem grovelling from fstat(1).
2013-07-01 15:22:00 +00:00
riastradh
6290b0987e Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9).
rndsink(9):
- Simplify API.
- Simplify locking scheme.
- Add a man page.
- Avoid races in destruction.
- Avoid races in requesting entropy now and scheduling entropy later.

Periodic distribution of entropy to sinks reduces the need for the
last one, but this way we don't need to rely on periodic distribution
(e.g., in a future tickless NetBSD).

rndsinks_lock should probably eventually merge with the rndpool lock,
but we'll put that off for now.

cprng(9):
- Make struct cprng_strong opaque.
- Move rndpseudo.c parts that futz with cprng guts to subr_cprng.c.
- Fix kevent locking.  (Is kevent locking documented anywhere?)
- Stub out rump cprng further until we can rumpify rndsink instead.
- Strip code to grovel through struct cprng_strong in fstat.
2013-06-23 02:35:23 +00:00
christos
3d7bb1da45 support printing rnd descriptor info 2012-11-25 15:30:28 +00:00
christos
0548a80ae0 return stuff for ksem 2012-11-25 01:05:49 +00:00
christos
c7c1f1a254 - add more debugging.
- in misctrans() we need the file index not the file type.
2012-11-25 00:36:23 +00:00
alnsn
4d1ae9a9af Report jit'ed bpf fildes in fstat. 2012-10-27 22:38:07 +00:00
christos
0d87ef641d print major device numbers symbolically from kinfo_drivers 2012-10-19 02:49:52 +00:00
christos
902a40f133 more info for unix sockets. XXX: chroot handling 2012-10-19 02:11:25 +00:00
wiz
fde0458761 - In the example for `-f', reference a directory that is actually
available in a default installation (/usr/src isn't);
- put together two lines which belong to the same sentence;
- remove a spurious space character;
- remove unneeded consecutive argument for `.Nm' macro.

From Bug Hunting.
2012-10-03 19:35:08 +00:00
christos
8e13556964 fix non-numeric address and port printing. 2012-09-26 23:01:04 +00:00
christos
0b08384416 byte swap the inet6 ports. 2012-03-24 21:51:23 +00:00
chs
585f34003b fix rdev reporting for UFS2 and ext2fs. 2011-10-09 21:16:00 +00:00
jnemeth
e894be756a add an xref to fstat(2) 2011-10-08 22:16:03 +00:00
mrg
81a1075469 apply some (uintptr_t) so that printing printers works on i386 (likely
all 32 bit.)
2011-09-23 07:31:39 +00:00
christos
a0af16e360 - factor out common code in the inet and inet6 printing.
- add appletalk (ddp) support.
2011-09-22 17:27:50 +00:00
christos
2ba0028160 - remove bogus casts
- print recycled vnode flags
2011-09-10 18:35:28 +00:00
christos
ebb6dc2ee4 add libutil. 2011-09-10 18:34:54 +00:00
christos
48bd4d9cb5 add all the possible fileops here, and if there is one we know about
print that instead of the passed name.
2011-09-10 18:34:40 +00:00
wiz
2a5f867d29 Remove trailing whitespace and use Sx for section crossreference. 2011-09-06 19:22:05 +00:00
christos
f5cf37944f move UNIX socket mention in the BUGS section. 2011-09-06 11:31:47 +00:00
wiz
ba45f45512 Remove duplicate RCS Id and split file system. 2011-09-05 18:27:31 +00:00
christos
44f7f983f5 - minor KNF
- for system processes (0, 1) where fd_lastfile == -1, fail early.
- instead of printing the pcb connection address, print the pathname if
  possible for unix domain sockets.
2011-09-03 13:24:19 +00:00
christos
21e29f6268 Mention that fstat -f will not list open unix sockets on that filesystem. 2011-09-03 13:22:55 +00:00
rmind
8a0123cd33 - Prevent tmpfs.h from inclusion in userland.
- Clean up and KNF tmpfs.h a little bit.
2011-05-29 01:00:50 +00:00
rmind
e7ba7d8ca0 Add DTYPE_SEM. 2011-04-14 00:35:35 +00:00
christos
585ce9eda6 move _KMEMUSER higher! 2009-07-13 21:44:32 +00:00
christos
d96e875904 need _KMEMUSER too. 2009-07-13 21:43:24 +00:00
christos
f73facbc14 sys/mqueue.h needs sys/types.h now 2009-07-13 17:57:35 +00:00
ad
d991fcb3b6 More changes to improve kern_descrip.c.
- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
  It was only being used to synchronize close, and in any case we needed
  to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
  that we can eliminate the membar_consumer() call in fd_getfile().  This is
  mostly syntactic sugar; the main functional change is that fd_nfiles now
  lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
2009-05-24 21:41:25 +00:00
lukem
c1ceae17f0 Enable WARNS=4 by default for usr.bin, except for:
awk  bdes  checknr  compile_et  error  gss  hxtool  kgetcred  kinit
	klist  ldd  less  lex  locale  login  m4  man  menuc  mk_cmds
	mklocale  msgc  openssl  rpcgen  rpcinfo  sdiff  spell  ssh
	string2key  telnet  tn3270  verify_krb5_conf  xlint
2009-04-14 22:15:16 +00:00
lukem
dadffc77c0 Fix sign-compare issues. 2009-04-12 06:36:12 +00:00
christos
90baf4f26f only print warnings if vflg. 2009-02-26 17:30:51 +00:00
wiz
0ca945fa16 Sockets: Do not mention printing flags, because they are not printed.
From Stephan A. Rickauer via jmc@openbsd.

Bump date.
2009-01-04 17:19:39 +00:00
christos
4fe86cf5b0 64 bit dev_t 2008-12-29 00:59:08 +00:00
gmcgarry
0e0358051d Cast f_type to signed integer before comparison with negative values. 2008-09-09 00:56:23 +00:00
pooka
f00b7c9b12 Solve the fstat-wants-to-look-at-kernel-data-structures in a nicer
way: don't export the fs internals to innocent userspace programs
which just want to mount the file system.
2008-07-29 09:10:09 +00:00
pooka
f99d5e92e0 include correct header 2008-07-28 18:05:09 +00:00
christos
8dd0b4459d handle more types. 2008-07-23 11:59:43 +00:00
lukem
93505eb7ec Add back rev 1.83. (hi christos!) 2008-07-23 00:57:53 +00:00
christos
380fafb740 a better attempt on printing dtype_misc 2008-07-22 22:58:04 +00:00
lukem
98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
eaa1a34779 handle NULL better. 2008-04-04 21:15:30 +00:00
christos
03829a56bb elementary handling for different types of DTYPE_FOO.
XXX: DTYPE_CRYPTO is unused.
XXX: should we change fd_clone() to pass a DTYPE_FOO?
2008-04-04 21:14:08 +00:00
christos
6238528d0f catch up with struct filedesc changes. 2008-04-04 18:27:00 +00:00
he
7fa93d44f6 Please repeat after me: I shall not define _KERNEL before including
<sys/types.h> in user-land programs.  Doing so causes build problems
for lots of our ports due to differences in how <sys/bswap.h> ends up
defining the swap functions/macros.
2008-03-23 23:01:21 +00:00
ad
5456139476 Catch up with recent file descriptor changes. 2008-03-22 02:39:06 +00:00
ad
703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
perry
8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00