minix/lib/libc/sys-minix
Ben Gras e8eeebcd47 vfs: mmap support
. libc: add vfs_mmap, a way for vfs to initiate mmap()s.
	  This is a good special case to have as vfs is a slightly
	  different client from regular user processes. It doesn't do it
	  for itself, and has the dev & inode info already so the callback
	  to VFS for the lookup isn't necessary. So it has different info
	  to have to give to VM.
	. libc: also add minix_mmap64() that accepts a 64-bit offset, even
	  though our off_t is still 32 bit now.
	. to support mmap, we need to create new references to FD's (such
	  as an FD) so that the mmapped object can never be removed even if
	  all FD's are closed. To do that we conceptually dup the
	  filedescriptor into a new range that is only visible to the system.
	  So there are FDS_PER_PROCESS fd's, which is more than OPEN_MAX,
	  per process, and user processes can still use up to OPEN_MAX
	  FD's. mmap()ped objects then get extra reference in the invisible
	  range so user processes can't close them. The in-vfs fd_set is
	  of size FDS_PER_PROCESS.
	. On exec() time, try to mmap() in the executable if available.
	  (It is not yet available in this commit.)
	. To support mmap(), add do_vm_call that allows VM to lookup
	  (to ino+dev), do i/o from and close FD's on behalf of other
	  processes.
	. To make this possible, a few functions have 2 more arguments
	  to make the target process explicit (instead of the implicit
	  global fp) and to specify whether the request is from a user
	  process or the system (which implies whether FD's starting at
	  OPEN_MAX are valid). These are close_fd, common_open, actual_llseek,
	  actual_read_write_peek, get_fd and get_filp2.

Change-Id: I831551e45a6781c74313c450eb9c967a68505932
2013-05-27 13:56:54 +00:00
..
__getcwd.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
__getlogin.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
_exit.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
_mcontext.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
_ucontext.c ARM support for system libraries 2012-08-28 13:49:27 -04:00
accept.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
access.c retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID 2012-03-25 21:58:20 +02:00
adjtime.c libc: add adjtime() system call. 2013-04-04 15:04:54 +02:00
bind.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
brk.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
chdir.c retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID 2012-03-25 21:58:20 +02:00
chmod.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
chown.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
chroot.c retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID 2012-03-25 21:58:20 +02:00
clock_getres.c libc: add clock_settime() system call. 2013-04-04 15:04:54 +02:00
clock_gettime.c libc: add clock_settime() system call. 2013-04-04 15:04:54 +02:00
clock_settime.c libc: add adjtime() system call. 2013-04-04 15:04:54 +02:00
close.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
connect.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
cprofile.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
dup.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
dup2.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
environ.c Remove ACK EM_WSIZE/EM_PSIZE macro usage 2012-08-06 17:49:22 +02:00
execve.c Removing obsolete _MINIX_SOURCE define 2013-02-26 09:44:21 +00:00
fchmod.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
fchown.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
fcntl.c retire _ANSI and <minix/ansi.h> 2012-03-25 21:58:27 +02:00
flock.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
fork.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
fpathconf.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
fstatfs.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
fstatvfs.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
fsync.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
ftruncate.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
futimens.c utimens(2) system call 2013-04-12 18:55:39 +00:00
futimes.c utimens(2) system call 2013-04-12 18:55:39 +00:00
getdents.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
getegid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
geteuid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getgid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getgroups.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getitimer.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
getpeername.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
getpgrp.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getpid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getppid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
getrlimit.c Fixed bug in getrlimit as core dumps are supported now. 2013-01-17 14:06:35 +00:00
getsid.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
getsockname.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
getsockopt.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
gettimeofday.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
getuid.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
init.c vm: fix kernel-requested mappings for arm 2013-01-29 17:57:04 +00:00
ioctl.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
issetugid.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
kill.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
link.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
listen.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
loadname.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
lseek.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
lseek64.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
lutimes.c utimens(2) system call 2013-04-12 18:55:39 +00:00
m_closefrom.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
Makefile.inc utimens(2) system call 2013-04-12 18:55:39 +00:00
minix_rs.c Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
MISSING_SYSCALLS utimens(2) system call 2013-04-12 18:55:39 +00:00
mkdir.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
mkfifo.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
mknod.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
mmap.c vfs: mmap support 2013-05-27 13:56:54 +00:00
mount.c Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
nanosleep.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
open.c retire _ANSI and <minix/ansi.h> 2012-03-25 21:58:27 +02:00
pathconf.c retire _CONST, _VOLATILE, _SIZET, _ARGS, _VOID 2012-03-25 21:58:20 +02:00
pipe.c VFS: implement pipe2 2013-02-28 10:08:53 +00:00
poll.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
pread.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
priority.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
ptrace.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
pwrite.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
read.c Fix prototypes for getdents, read, readlink 2012-08-10 22:09:43 +02:00
readlink.c Fix prototypes for getdents, read, readlink 2012-08-10 22:09:43 +02:00
reboot.c Remove ability to pass commands to bootloader 2012-11-22 19:16:17 +01:00
recvfrom.c use __restrict instead of restrict 2012-03-30 17:37:53 +02:00
recvmsg.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
rename.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
rmdir.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sbrk.c retire PUBLIC, PRIVATE and FORWARD 2012-03-25 21:58:14 +02:00
select.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
sem.c Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
sendmsg.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sendto.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
setgid.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
setgroups.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
setitimer.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
setsid.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
setsockopt.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
settimeofday.c libc: add clock_settime() system call. 2013-04-04 15:04:54 +02:00
setuid.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
shmat.c Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
shmctl.c Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
shmget.c Removing obsolete _MINIX define 2013-02-26 09:44:20 +00:00
shutdown.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sigaction.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
sigpending.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
sigprocmask.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
sigreturn.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sigsuspend.c Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
sizeup.c Rename "struct partition" to "struct part_geom" 2013-03-20 16:14:21 +00:00
socket.c socket: implement SOCK_CLOEXEC and SOCK_NONBLOCK 2013-02-28 10:08:53 +00:00
socketpair.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sprofile.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
stat.c Spring cleanup 2013-03-06 09:56:08 +00:00
statvfs.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
stime.c Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
symlink.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
sync.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
syscall.c SYSENTER/SYSCALL support 2012-09-24 15:53:43 +02:00
sysuname.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
truncate.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
umask.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
unlink.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
utimensat.c utimens(2) system call 2013-04-12 18:55:39 +00:00
utimes.c utimens(2) system call 2013-04-12 18:55:39 +00:00
vectorio.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
vfork.c various symbol referencing fixes 2012-06-28 15:20:53 +02:00
write.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00