Commit graph

310 commits

Author SHA1 Message Date
Lionel Sambuc 3bae8fe45a Message type for VFS_PIPE2
Change-Id: I01c599cf035d8f103220baae54fefbc80d12fbd2
2014-07-28 17:05:32 +02:00
Lionel Sambuc befa020a9e Message type for VFS_TRUNCATE
Change-Id: I6f51c979c8986660883221d3acfa07d1c1b25dff
2014-07-28 17:05:32 +02:00
Lionel Sambuc 268d670a85 Message type for VFS_LSEEK
Change-Id: I592284078572e4abf2b181d3b4e8281c9baf8a7b
2014-07-28 17:05:32 +02:00
Lionel Sambuc 9ceebd7a4b Message type for VFS_FSYNC
Change-Id: Iae9d27dbf40bc5567de6c5960f5cbe174be00dbd
2014-07-28 17:05:31 +02:00
Lionel Sambuc a57fc8f683 Message type for VFS_IOCTL
Change-Id: Ibea0fd2f443c1332bf1c9d138840d838bfc81d81
2014-07-28 17:05:31 +02:00
Lionel Sambuc a16ccbaaf8 Message type for VFS_UMOUNT
Change-Id: Ia3b8e818b45a31178215cad77fa0fa3e5325f18a
2014-07-28 17:05:31 +02:00
Lionel Sambuc ecc9010c4b Message type for VFS_MOUNT
Change-Id: I4114f5a1aa4f9efe49a12996722499b695c17230
2014-07-28 17:05:30 +02:00
Lionel Sambuc ad7e3e56c8 Message type for VFS_{,F}STATVFS1
Change-Id: Iaf71cdddb48f64d84773029da2c0666f5462f198
2014-07-28 17:05:30 +02:00
Lionel Sambuc ccdf11c7cf Message type for VFS_GETVFSSTAT
Change-Id: I27f1f6dc37832ee4adb9854c7306ce6153e31567
2014-07-28 17:05:30 +02:00
Lionel Sambuc 7332005370 Message type for VFS_SELECT
Change-Id: Ifd6cb7082dd528f1698a0ca070de447aad85ba60
2014-07-28 17:05:30 +02:00
Morgawr 91c835edc2 added sethostname syscall with proper error checks
Change-Id: I4b4e0a7c4035e19d5843b86ee1f714096adcecd2
2014-07-28 17:05:24 +02:00
Lionel Sambuc afe5cecd7f Stub for setpgid
This implements a near noop setpgid, unless the use is one equivalent
to setsid, in which case it will behave as such.

Also activates setpgrp, which is implemented in terms of setpgid.

Change-Id: I84411cb1957351aa1d3985623cd9e69bdf6f8d4c
2014-07-28 17:05:24 +02:00
Lionel Sambuc ac5b3e53d8 Stub for setrlimit
Change-Id: I54c7233d71805711bd72e1e751456aad30fd3e35
2014-07-28 17:05:23 +02:00
Lionel Sambuc 78cfc9712b Prefix libc (u)mount with minix_
The goal is to prevent a name collision with the expected mount/umount
function signatures, if we decide one day to allow any application
using those to work on MINIX.

At this moment the caller has to start the required services, but if we
implement that logic inside the mount/unmout function, this would allow
any application to call those function successfully.

By renaming those now, we prevent a possible ABI break in the future.

Change-Id: Iaf6a9472bca0dda6bfe634bdb6029b3aa2e1ea3b
2014-07-28 17:05:23 +02:00
Lionel Sambuc f86720112c Follow the namespace pattern for [cs]profile
Change-Id: I5ad7eb1d7f4b4364e668c2f30dfc628f89b0d579
2014-07-28 17:05:22 +02:00
Lionel Sambuc 193733f9e2 Hide SO_PASSCRED and SO_PEERCRED by default.
This cause in some software to assume we are linux, as this is rightly
only used there.

By default hide it behind _MINIX_SYSTEM, until we have removed traces
of it from getpeereid/[gs]etsocketopt and replaced it by the NetBSD
mechanism.

Change-Id: Iacd4cc1b152bcb7e90f5b1249185a222c90351d6
2014-07-28 17:05:22 +02:00
Kees Jongenburger 8991ca4e5a libc:x86 fix for get and setcontext assembly calls.
The get and set context calls where wrongly assuming that the value
of arguments passed on the stack where kept unmodified.

Change-Id: I779b08d7f5a6472c5e9dc351ae44abb2acafb3bd
2014-07-28 17:05:21 +02:00
Kees Jongenburger 69b8ce6ab2 x86:ensure that getcontext will return 0.
The setcontext method did not alway set the return value to 0 after
restoring the desired context. Specially When calling setcontext with
the _UC_IGNSIGM and the _UC_IGNFPU flags the return value would be non
zero.

Change-Id: Iec7f8d6a680950aa53e3c88c86e03f65005e66b2
2014-07-28 17:05:21 +02:00
Lionel Sambuc 18f97ad415 Workaround missing lchmod/lchown
Change-Id: I231a0010722619d389b763af35ff55f84ca9cb76
2014-07-28 17:05:20 +02:00
Ben Gras 0b79eac642 mmap: accept non-PROT_WRITE MAP_SHARED mappings
Currently we don't accept writable file mmap()s, as there is no
system in place to guarantee dirty buffers would make it back to
disk. But we can actually accept MAP_SHARED for PROT_READ mappings,
meaning the ranges aren't writable at all (and no private copy is
made as with MAP_PRIVATE), as it turns out a fairly large class of
usage.

	. fail writable MAP_SHARED mappings at runtime
	. reduces some minix-specific patches
	. lets binutils gold build on minix without further patching

Change-Id: If2896c0a555328ac5b324afa706063fc6d86519e
2014-07-28 17:05:20 +02:00
Ben Gras 3f38115c7b _MINIX_SYSTEM - fixes for in-minix crossbuild
. define _MINIX_SYSTEM for all system code from minix.service.mk
	. hide some system-level declarations and definitions
	  behind _MINIX_SYSTEM to cleanly fix host tool build problems on
	  Minix (such as: NONE being defined and paddr_t being used but not
	  declared)
	. the similar definition _SYSTEM is unsuitable as it changes the
	  values of errno definitions

Change-Id: I407de79e2575115243a074b16e79546a279cfa3e
2014-07-28 17:05:14 +02:00
Ben Gras e6daf20a69 64-bit VFS_LSEEK_OFF
Change-Id: Ic0b6d65cbde1033462b909436efa92464094f1ec
2014-07-28 17:05:11 +02:00
Ben Gras 188a5fde1f 64-bit VFS_TRUNCATE_OFF
Change-Id: I4bd5cc57ddda2525b0bec6f044f35196a2c21f2e
2014-07-28 17:05:10 +02:00
Lionel Sambuc 03514ba605 Getting rid of "old-style-definition"
Patch submitted by hoefnix. Ref.
https://groups.google.com/d/msg/minix-dev/sHQDVJRyx1c/eJjrYOqk5bgJ

Change-Id: I2fcdf4cf119ef252ccc7df06849baf37ffd08440
2014-07-28 17:05:09 +02:00
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras 7597f4a8fc <machine/signal.h>
. use netbsd sigframe, sigcontext struct
	. netbsd sigframe *contains* sigcontext; use that directly
	  in kernel sigsend
	. drop two fields from minix x86 stackframe.h (process context)
	  that were unused, retadr and st

use in-sigframe sigcontext

Change-Id: Ib59d699596dc3a78163dee59f19730482fdddf11
2014-03-03 20:47:07 +01:00
Ben Gras aae07bc777 <sys/ioccom.h>, <sys/ioctl.h>
. use <sys/ioccom.h> to make ioctls
	. use netbsd <sys/ioctl.h>, include minix ioctls
	. convert to varargs ioctl() like netbsd

Change-Id: Id5165780df48172b28bf0003603516d30d7c1abb
2014-03-03 20:47:06 +01:00
Ben Gras ad9df9a490 <sys/syslimits.h>
reduces differences, raise NAME_MAX

Change-Id: I2e5f6296e6539162c52fdf13fb1fd27a56587e0c
2014-03-03 20:47:06 +01:00
Ben Gras 46b89a731b <sys/resource.h>
Change-Id: I5858e1b56e65fc9cf480120d96c68770d3a11dd2
2014-03-03 20:47:06 +01:00
Ben Gras 1ef83ee923 <sys/param.h>
Change-Id: I53d0ca207789f27e3a01acdd184ade24630d9a00
2014-03-03 20:47:04 +01:00
Ben Gras 9c031c9d7f <sys/ptrace.h>
Change-Id: Ib930c661c1e6de05b2e0d5fce4ffc1ae2269fc6a
2014-03-03 20:47:04 +01:00
Ben Gras 81473dbba0 <vmparam.h>
Change-Id: I941ea3111703ed089bfdaf87d26158ab8697a80d
2014-03-03 20:47:04 +01:00
Ben Gras 5cecdfcb3e <machine/mcontext.h>
Change-Id: I2ad64018f3f402e7ccc5c4dc037dd0a3fe56a929
2014-03-03 20:47:03 +01:00
Ben Gras 17587738d3 align <sys/ucontext.h> <sys/uio.h> <sys/un.h>
Change-Id: I70adf01fddf931a3a6931083adaa4bbe647ea6a3
2014-03-03 20:47:03 +01:00
Ben Gras 01624e6f86 <sys/socket.h>, <netinet/{in,tcp,udp,udp_var}.h>
. add sa_len to sockaddr, sin_len to sockaddr_in
	. rename SCM_CREDENTIALS to SCM_CREDS
	. retire PF_FILE (same as PF_UNIX)

Change-Id: Id3ec63fe2556fc7ceb48de8ad4e80736df3ddfc7
2014-03-03 20:47:03 +01:00
Ben Gras dda632a24f drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of
mmap-related testing.

Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
2014-03-03 20:47:03 +01:00
Lionel Sambuc d3b0a89bab include/unistd.h: merged
Also removing lseek64, pread64, pwrite64.

Those functions have lost their "raison d'être", when off_t switched to
64bits.

Change-Id: I5aea35f01d6d10e3d6578a70323da7be5eca315a
2014-03-03 20:47:02 +01:00
Lionel Sambuc afc1f71188 include/paths.h: merged
Change-Id: I5e2aa0bc99a596f82ef4224f22623bcb83cb98b5
2014-03-03 20:47:01 +01:00
Lionel Sambuc e9e08def23 remove special handling of rename()
Change-Id: I69694e155250dc5f527dacbaf3f0ecbdc4873989
2014-03-03 20:47:01 +01:00
Lionel Sambuc b33edbfe7a Removing VFS_UTIMENS_* field macros.
Change-Id: I3be1acfbb77b6e229d784d8dbc3ceec1b26abf90
2014-03-03 20:47:00 +01:00
Lionel Sambuc 301f5f87f0 Renamed m_vm_vfs to m_vm_vfs_mmap.
Stay coherent with the naming scheme of the messages.

Change-Id: Icc0e13a88ec29263502166c0e6eec81cdb974663
2014-03-03 20:47:00 +01:00
Lionel Sambuc 175d3e7eae Changing the message union to anonymous.
This allows us to write things like this:
  message m;
  m.m_notify.interrupts = new_value;

or
  message *mp;
  mp->m_notify.interrupts = new_value;

The shorthands macro have been adapted for the new scheme, and will be
kept as long as we have generic messages being used.

Change-Id: Icfd02b5f126892b1d5d2cebe8c8fb02b180000f7
2014-03-03 20:46:47 +01:00
Lionel Sambuc 4a0199d66d PM_TIME_SEC into 64bit
Change-Id: I609ee8cac7aae8af2c0c0381710433a5df0caebd
2014-03-03 20:45:28 +01:00
Lionel Sambuc 55d9e9954b Extending time_t to 64bits.
Change-Id: Ia96b8bfba19cb8179a0237a7d2122d415c24d73f
2014-03-03 20:45:28 +01:00
Ben Gras 88be7bd333 Use netbsd <sys/mman.h>
Change-Id: I80e9cffc80140383a6faf692248573c64d282b4a
2014-03-03 20:37:27 +01:00
Ben Gras 364953ad40 <sys/stat.h>
current version of <sys/stat.h> from netbsd repo is older than the minix
one; will be corrected on next netbsd re-import.

Change-Id: Ifc696581ef476cfecd9695a9f6e74b844131e584
2014-03-02 12:28:33 +01:00
Lionel Sambuc 37598dccf1 Aligning dev_t to 64bits.
Change-Id: I630f72f8530dd4aaf05c35ca23683ae12c9f8328
2014-03-02 12:28:32 +01:00
Lionel Sambuc a00e322bea libc/sys-minix/mount.c: fix overflow
Fix a bug where a filesystem label could overflow the reserved buffer.
This was already possible with 32 bits values, but is more proeminent
with dev_t being 64 bits.

Change-Id: Idc04ed355d1dd92b7a8ce4699de832661a5c4ccd
2014-03-02 12:28:32 +01:00
Lionel Sambuc 9a2e578a5c Remove sys/stdlib.h
This file was copied over to allow for the compilation of some
of the arch/i386 code, due to a bug in lib/libc/compat/Makefile.inc.

This patch fixes the situation, and removes the now useless header, as
well as remove a patch in lib/libc/stdlib/putenv.c

Change-Id: Ic5e4c4bb967f58f6e874c091788e1dd5ecaebe5e
2014-03-02 12:28:31 +01:00
Ben Gras 8ccb12bb5a use netbsd <sys/signal.h> and sigset_t
. create signals-related struct message type to store sigset_t
	  directly
	. create notify-specific message types, so the generic NOTIFY_ARG
	  doesn't exist anymore
	. various related test expansions, improvements, fixes
	. add a few error-checks to sigismember() calls
	. rename kernel call specific signals fields to SYS_*

Change-Id: I53c18999b5eaf0cfa0cb25f5330bee9e7ad2b478
2014-03-02 12:28:31 +01:00