101 Commits

Author SHA1 Message Date
Saagar Jha
0e642a0995 Prevent signed overflow by using qword_t 2020-03-08 23:02:09 +00:00
Saagar Jha
b33cbacb59 Fix pread/pwrite; make read/write be optional
pread and pwrite have been fixed to return the correct (unchanged) offset. In
addition, both functions have been added to fd_ops and sys_read and sys_write
will use these if they are available; making them (fd_ops's read/write)
effectively optional if there is an implementation of pread and pwrite
available. lseek is no longer optional.
2020-03-08 23:02:09 +00:00
Theodore Dubois
e17b822519 Make most fs_ops optional, and mark the required ones 2020-02-03 00:43:54 -08:00
Theodore Dubois
6b5a14850c Implement mknodat 2020-02-02 22:35:58 -08:00
Theodore Dubois
8ff84f2ae3 Handle different clock IDs in timerfd_create
Also handle TFD_TIMER_ABSTIME in timerfd_settime.

Fix #591
2020-01-03 20:13:17 -08:00
Theodore Dubois
7442f2327b Remove obsolete TODO for utime 2019-12-30 00:10:26 -08:00
Theodore Dubois
389bd5ebe9 Make statfs return the correct answer
Fixes #509
2019-10-13 21:26:33 -07:00
Theodore Dubois
a9e4aa41c6 Add logging for llseek and rmdir 2019-10-13 20:14:48 -07:00
Theodore Dubois
c1eb8e2598 Remove low-signal logs for unknown ioctls and shared futexes 2019-10-06 18:36:24 -07:00
Theodore Dubois
fd5729dc1a Allow access() to succeed with F_OK 2019-09-21 19:45:35 -07:00
Theodore Dubois
3bd114ae48 Attempted implementation of pwrite 2019-08-11 22:15:36 -07:00
Theodore Dubois
635a8437f8 Add a bunch of half-assed permission checks 2019-07-28 21:04:38 -07:00
Theodore Dubois
95cee3f3ed Implement utime 2019-07-07 17:37:00 -07:00
Theodore Dubois
80bd91a2ea Implement 32-bit statfs 2019-05-11 23:13:52 -07:00
Theodore Dubois
cebd8758ec Add strace for chmod and chown 2019-05-05 13:17:09 -07:00
Theodore Dubois
480fde90f7 Implement utimes 2019-05-01 14:41:08 -07:00
Theodore Dubois
cef1841a40 Make it possible to run init
If you set the init command to /sbin/init, you'll see it fail to run openrc and then start a working getty.
2019-05-01 08:53:25 -07:00
Theodore Dubois
d91c26a2e4 Deduplicate iovec structs 2019-03-09 15:31:53 -08:00
Theodore Dubois
82ad92d010 Stub renameat2
Fixes #312
2019-02-12 14:54:27 -08:00
Theodore Dubois
a916f874fd Make FIONBIO take an argument 2019-01-26 17:39:45 -08:00
Theodore Dubois
db1ce07b42 Make FIONBIO work with real files 2019-01-24 10:59:07 -08:00
Theodore Dubois
4da246affb Correctly handle termios of pseudoterminals 2019-01-22 12:49:04 -08:00
Theodore Dubois
088e7b727d Implement ptys
Also a bunch of somewhat related changes, I was too lazy to break this into more than one commit
2019-01-21 12:20:43 -08:00
Theodore Dubois
21a2db30e5 Ignore flags argument to fchmodat, like the kernel does 2019-01-21 11:38:06 -08:00
Theodore Dubois
cfc2017948 Fix out of bounds write in readlink 2019-01-12 16:49:24 -08:00
Theodore Dubois
89d5b7f69a Resolve -Wsign-compare 2019-01-05 18:11:16 -08:00
Theodore Dubois
1b22ddb9bd Resolve -Wmissing-field-initializers 2019-01-05 17:29:11 -08:00
Theodore Dubois
032a218a63 Mark unused function arguments 2019-01-05 17:18:54 -08:00
Theodore Dubois
b04f6f1b3b Remove some unnecessary function arguments 2019-01-05 17:18:54 -08:00
Theodore Dubois
8eb4b800a5 Implement /proc/pid/fd, /proc/self 2019-01-03 13:50:08 -08:00
Theodore Dubois
137e1a2814 Overhaul fdtable implementation to add locking 2019-01-02 21:50:25 -08:00
Theodore Dubois
7f48c0e806 Stub copy_file_range 2018-12-27 20:21:07 -08:00
Theodore Dubois
ca3dd4a4ad Make statfs less broken 2018-12-27 16:25:33 -08:00
Theodore Dubois
3c8a38e7cd Fix fd leak from chroot 2018-12-26 17:29:52 -08:00
Theodore Dubois
e6ffd60dd6 Add strace for statfs 2018-12-26 17:29:44 -08:00
Theodore Dubois
3fd114733a Half broken epoll implementation 2018-12-25 19:05:25 -08:00
Theodore Dubois
f8028736b4 Make mounting filesystems possible 2018-12-22 19:38:41 -08:00
Theodore Dubois
4756717512 Handle AT_REMOVEDIR flag for unlinkat 2018-12-10 16:56:15 -08:00
Theodore Dubois
4ba6da7635 Implement FIONREAD for ttys 2018-12-10 12:39:29 -08:00
Theodore Dubois
ec475f2d87 Initial implementation of timerfd 2018-12-10 12:27:45 -08:00
Theodore Dubois
b9b0b8f261 Stub out all the xattr system calls 2018-12-08 17:31:28 -08:00
Theodore Dubois
a9bd656d2b Implement mknod in fake/real fs 2018-12-07 11:58:51 -08:00
Theodore Dubois
852a04d07f Implement generic mknod 2018-12-07 09:48:25 -08:00
Theodore Dubois
8985d83185 Implement lchown 2018-11-25 13:45:36 -08:00
Theodore Dubois
95af8cba0a Don't copy out buffer if sys_read fails 2018-11-24 18:21:42 -08:00
Theodore Dubois
9eea489997 Unbreak getcwd 2018-11-21 14:09:42 -08:00
Theodore Dubois
2a5cb4ced6 Fix up error handling in fs.c 2018-11-21 13:24:46 -08:00
as@irc
47c0e2b0ab Changed filesystem temp buffers to use heap allocations. 2018-11-21 13:17:18 -08:00
Theodore Dubois
2b35a6e9e6 Implement ioctl(FIONBIO) 2018-11-16 14:38:32 -08:00
Theodore Dubois
7f74a54fd0 Implement pipe2 with O_CLOEXEC 2018-11-16 13:59:49 -08:00