Commit Graph

157 Commits

Author SHA1 Message Date
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
dyoung ca1b22492a Bug fix: filed.fd_ofiles is always a pointer to the open files
table, so always read the table from kernel virtual memory at that
address.  Do not ever try to read the table from filed0.fd_dfiles,
because it just isn't necessary, and sometimes we read a stale
table from there.
2007-09-09 01:26:55 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
hubertf 53f3b1d56f Xref sockstat(1) 2006-07-29 14:46:13 +00:00