Commit Graph

120 Commits

Author SHA1 Message Date
Giacomo Tesio 1e34cf5efb copyright: update 9front's url (they moved from hg to git) 2021-12-30 00:55:39 +01:00
Giacomo Tesio 0adf1b0431 new build: get rid of Go with few rc scripts. 2021-12-30 00:55:06 +01:00
Giacomo Tesio 922e993c41 libs, kernel and commands: re-enable -Werror 2020-11-15 13:30:09 +01:00
Giacomo Tesio 16c7924425 libs: get rid of libstdio (and stdio.h); `mv ctype.h chartypes.h` in /sys/include 2020-09-17 23:53:35 +02:00
Giacomo Tesio 0a325039bf gcc & system build: add `-9` and remove `--posix` from build files 2020-09-17 23:53:12 +02:00
Giacomo Tesio 72af45032e libposix: turn notes like "sys: trap: general protection violation" to SIGSEGV 2020-09-17 23:50:25 +02:00
Giacomo Tesio 2f850291d5 rename libc to libjehanne; improve libposix
This is to avoid conflicts between standards' assumptions and Jehanne's choices
2020-09-17 23:48:27 +02:00
Giacomo Tesio 4067cb45cb libc: refactoring 2020-09-17 23:47:39 +02:00
Giacomo Tesio f104c46858 purge syscall macros 2020-09-17 23:45:23 +02:00
Giacomo Tesio 5f095a9605 temporarily disable -Werror 2020-09-17 23:43:57 +02:00
Giacomo Tesio 361a06f284 libc: move read and write to jehanne_ namespace (where they actually belong) 2020-09-17 23:43:56 +02:00
Giacomo Tesio 63d860eb99 u.h: refactoring of syscalls 2020-09-17 23:42:55 +02:00
Giacomo Tesio a15c1111b8 libposix: POSIX_rmdir 2019-11-20 00:19:59 +01:00
Giacomo Tesio b57585fdf4 libposix: fix cast warning 2019-11-19 01:36:08 +01:00
Giacomo Tesio 49da4de25c posix: POSIX_sysconf 2019-11-18 00:53:09 +01:00
Giacomo Tesio ea21d3cd2d libposix: add support for O_NONBLOCK
We keep a list of non blocking fds and use awake to
make them not block on read, write, pread and pwrite.
2018-01-15 22:37:27 +01:00
Giacomo Tesio dd9aa0e0a6 More explicit Copyright in files 2018-01-06 01:09:04 +01:00
Giacomo Tesio c7d0f621c9 Clarify Forsyth's and 9front's copyrights
I'm very grateful to Charles Forsyth for creating most of Jehanne's kernel
and to 9front's guys for all the code and ideas they freely share.

Here I make their copyrights explicit as they had been erroneusly omitted
or messed up before. Sorry.
2018-01-05 02:30:45 +01:00
Giacomo Tesio 8ed3e74c3f libposix: fix setpgid: if the target process is already a group leader, do nothing 2017-12-25 13:13:09 +01:00
Giacomo Tesio 001069aa7b libposix: deep refactor; add sys/posixly command
With these changes, libposix (and newlib) can run MirBSD Korn Shell.
2017-12-18 23:02:36 +01:00
Giacomo Tesio 8c5dff6c0b libc: add pexec() to execute a command in $PATH 2017-12-15 02:58:09 +01:00
Giacomo Tesio 2dcdf47b04 libc: simplify getuser 2017-12-15 02:58:09 +01:00
Giacomo Tesio 9f8050aa4a libc: move exits to its own translation unit (another good idea from 9front) 2017-10-25 01:11:34 +02:00
Giacomo Tesio 9202b04504 rc: use some uppercase variables (PATH, USER...) 2017-10-22 13:22:37 +02:00
Giacomo Tesio fab9c1d80f libc: introduce <envvars.h>
The new header envvars.h contains the names of commonly used
environment variables, such as $user, $ifs, $path and so on.

These defines are useful for Jehanne core applications that
use them to comunicate some values.

They are not strictly required, but having such defines we
can easily change the naming convention (from lowercase to uppercase).
2017-10-20 01:22:48 +02:00
Giacomo Tesio 26a2f0a1be libposix: fix typos in get_noteid/set_noteid 2017-09-08 00:24:37 +02:00
Giacomo Tesio e206015f7f libposix: add getpgid 2017-09-07 23:27:33 +02:00
Giacomo Tesio 1f3203e6d3 libposix: add rename 2017-09-07 23:25:34 +02:00
Giacomo Tesio e3ff5b1004 libposix: add getpgrp; draft setsid, getsid and setpgid 2017-09-07 00:10:34 +02:00
Giacomo Tesio e168dcb7fa libposix: add umask 2017-09-06 22:59:05 +02:00
Giacomo Tesio 61f0293e39 libposix: fake get/set functions for uid, gid, euid, egid, pgid, sid, reuid... 2017-09-05 23:53:40 +02:00
Giacomo Tesio 4be2181f89 libposix: add readlink and readlinkat (both failing with EINVAL) 2017-09-03 23:46:18 +02:00
Giacomo Tesio c5aaa72bbb libposix: add dup, dup2, getrusage, fstat and lstat 2017-09-03 17:51:44 +02:00
Giacomo Tesio 4115f92ff6 libc: make times return -1 on io error 2017-09-03 17:43:02 +02:00
Giacomo Tesio 0bc2e60c72 libposix: stub chown family (always returning 0)
I do not expect chown, fchownat and lchown to be much used in
UNIX softwares that we care to port.

We stub the functions in libposix so that we can refer them from
standard C libaries (such as newlib).

We will implement them (parsing /cfg/users to determinate uid and gid)
when it will be actually needed from a software ported to Jehanne.
2017-08-31 00:50:31 +02:00
Giacomo Tesio 713eb8843f libc: simplify access; libposix: let access lie
There are a few issues with Plan 9's `access`:

- it has side effects: to test the actual access (that the file
  servers can allow or deny according to complex custom rules)
  it opens and then closes the file, allocating (and disposing) the fd
- it does not work on directories, since
  - they cannot be opened for writing, despite the fact that to
    create a file in a directory you must be granted write access on
    that directory
  - they cannot be opened for execution, despite the fact that to
    access a file in a directory you must be granted execution access
    on that directory

Despite the fact that `access` (even on UNIX) is a violation of the
"tell, don't ask" principle (the access could be forbidden just after
its successful return, making subsequent `open` fail anyway), this
fact smells of a little design error in the file interface.

So, right now we choose to let the libposix's `access` lie on directories:
it will always return 0 on AWRITE and AEXEC for them, accepting that
a successive create/mkdir may fail.

However, a cleaner file API and protocol should allow a simpler `access`
to be implemented for directories too.
2017-08-29 00:17:51 +02:00
Giacomo Tesio 56287a4337 libc: better access on directories 2017-08-28 23:04:32 +02:00
Giacomo Tesio 59e881c04d libc: improve access(AWRITE) and access(AEXEC) on directories 2017-08-28 23:04:30 +02:00
Giacomo Tesio b78613615d libposix: add access 2017-08-28 23:04:12 +02:00
Giacomo Tesio 386cb370a6 libposix: POSIX_gettimeofday fails without proper initialization 2017-08-25 23:43:14 +02:00
Giacomo Tesio bd149a18f1 libposix: implement gettimeofday 2017-08-25 00:53:10 +02:00
Giacomo Tesio bfb95a3d3e libposix: drafted chdir, fchdir and mkdir 2017-08-23 04:05:31 +02:00
Giacomo Tesio 4de95c9bc0 libposix: make AT_FDCWD value configurable 2017-08-23 02:57:41 +02:00
Giacomo Tesio 4455658796 libposix: drafted chmod/fchmod; TODO: configurable AT_FDCWD 2017-08-23 01:05:54 +02:00
Giacomo Tesio 6a94e587a6 libposix: fix POSIX_open's DMDIR management; fix typo in POSIX_chmod 2017-08-22 22:42:38 +02:00
Giacomo Tesio 965d316ac4 libposix: return PosixENOTDIR according to O_DIRECTORY specification 2017-08-22 02:34:00 +02:00
Giacomo Tesio 9947978c05 libposix: implemented libposix_getdents 2017-08-22 01:42:33 +02:00
Giacomo Tesio f7c3a41b11 libposix: drafted getdents 2017-08-21 01:05:40 +02:00
Giacomo Tesio 3916b222b5 libposix: fix typo 2017-08-21 00:52:57 +02:00
Giacomo Tesio ea6b68588c libposix: implemented getcwd, getlogin, getlogin_r, getpass, pread and pwrite 2017-08-21 00:20:12 +02:00