Commit Graph

475 Commits

Author SHA1 Message Date
christos 35ca6c8b5b Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
2006-08-17 17:11:27 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
pavel a78062784c Use the new socket call for Linux and SVR4, because those systems (at
least Linux 2.4.31, Irix 6.5.20 and Solaris 10) use EAFNOSUPPORT.

Only the Linux emulation has been tested.

XXX somebody should audit the other emulations...
2006-06-27 09:09:40 +00:00
mrg e2eb31d3a3 version the socket(2) syscall. for compat30 socket, we use
EPROTONOSUPPORT instead of EAFNOSUPPORT.

from pavel@ with a little bit of clean up from myself.

XXX: netbsd32 (and perhaps other emulations) should be able
XXX: to call the standard socket calls for this i think, but
XXX: revisit this at another time.
2006-06-26 21:23:56 +00:00
christos 430ad9c2a9 don't allocate > 1K on the stack. 2006-06-13 02:31:28 +00:00
christos d5ba7564d8 stack police: don't allocate statvfs on the stack. 2006-06-09 23:24:24 +00:00
drochner 21166bafa5 regen 2006-05-29 09:46:54 +00:00
drochner 9575ca7cfd Remove emulation of ntp_gettime. In preparation for "timecounters" we
will change "struct ntptimeval", so some translation would be necessary.
ntp_gettine is considered dispensable, the only userland program known
to use it is "ntptime".
2006-05-29 09:44:51 +00:00
elad 874fef3711 integrate kauth. 2006-05-14 21:19:33 +00:00
christos ca0ec852e6 XXX: GCC uninitialized 2006-05-14 03:40:02 +00:00
mrg a07ab709de cast to (lwpid_t *) where appropriate. 2006-05-11 01:00:43 +00:00
mrg de67006891 cast to (socklen_t *) where appropriate. 2006-05-11 01:00:02 +00:00
macallan f8e479a39b correct a typo 2006-04-02 17:09:01 +00:00
macallan 3bd975beb8 declare len before using it 2006-04-02 17:08:23 +00:00
christos af0a2a9e7a Add a new lifnum sockio. 2006-04-02 07:17:16 +00:00
christos e5c9c0c478 minor nits 2006-04-02 06:44:23 +00:00
macallan c0007febd1 add a dummy implementation of the schedctl() syscall 2006-04-02 06:34:18 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
perry 0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos ca3a193432 factor out some of the osockaddr, omsghdr code. 2005-09-24 15:51:03 +00:00
christos 758a209d23 64 bit inode changes. 2005-08-19 02:03:49 +00:00
christos c0ee8a4184 Fix systeminfo.
1. return length is the string length even if the string would not fit.
2. add SI_ISALIST
3. on 32 bit emulation, don't return sparc64 as the arch!
2005-07-28 03:50:52 +00:00
christos fb4b40b7e8 - sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
  an api change.
- avoid variable shadowing.
2005-05-29 22:08:16 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
christos a5fb891bb9 PR/29696: Joel Carnat: NetBSD freezes when accessing smbfs mounted FS with
firefox/linux due to compat getdents() call assumption that all filesystems
support cookies.
2005-04-19 19:00:25 +00:00
fvdl c487efe4a7 Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.
* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.
2005-03-26 05:12:34 +00:00
perry 77f2a006d0 regen 2005-02-26 23:58:19 +00:00
perry ed10d3c508 make this rebuild generated files by default 2005-02-26 23:50:14 +00:00
perry 477853c351 nuke trailing whitespace 2005-02-26 22:58:54 +00:00
christos be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
christos 31c81b28f5 Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat
2004-11-30 04:25:43 +00:00
david d7d15131bb Bounds check syscall arguments where appropriate 2004-10-27 19:29:57 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
jdolecek f83c14f534 only include emulation syscallnames with SYSCALL_DEBUG, it's not used otherwise 2004-09-12 10:38:25 +00:00
pk f0f0f16529 svr4_sys_ioctl(): acquire a reference to the file. 2004-06-01 10:38:39 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
christos 34728fd71f more statvfs1 fallout. 2004-04-21 02:40:05 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
dmcmahill 888e67edcc Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get the
hostid of the machine rather than always getting "0".  Tested with
hostid(1) from solaris-2.8 and with lmhostid (part of FlexLM) for solaris.
Approved by atatat@.
2004-04-19 02:55:40 +00:00
drochner 4f5b1431f9 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:01:16 +00:00
fvdl d99705e941 Put back Emmanuel's sigfilter hooks, as decided by Core. 2003-12-20 19:01:29 +00:00
manu b23b73b953 Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.
2003-12-20 18:22:16 +00:00
jdolecek 0e253cf5f5 back the sigfilter emulation hook change off 2003-12-05 21:12:42 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
manu 18e13eee35 Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)
2003-12-03 20:24:51 +00:00
thorpej 052ba0ec50 We have CVS; there is no reason to make .bak files when generating the
syscall tables.
2003-11-15 20:30:59 +00:00
dsl 0342c9586a - Count number of zombies and stopped children and requeue them at the top
of the sibling list so that find_stopped_child can be optimised to avoid
  traversing the entire sibling list - helps when a process has a lot of
  children.
- Modify locking in pfind() and pgfind() to that the caller can rely on the
  result being valid, allow caller to request that zombies be findable.
- Rename pfind() to p_find() to ensure we break binary compatibility.
- Remove svr4_pfind since p_find willnow do the job.
- Modify some of the SMP locking of the proc lists - signals are still stuffed.

Welcome to 1.6ZF
2003-11-12 21:07:37 +00:00
drochner 714de0452f adapt for changes to kern/exec_elf32.c 2003-10-31 14:04:35 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00