jehanne/qa/lib/c
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
..
access.c libc: simplify access; libposix: let access lie 2017-08-29 00:17:51 +02:00
asmscall.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
build.json libposix: add access 2017-08-28 23:04:12 +02:00
cleanname.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
conswrite.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
env.rc libc: rewrite putenv and getenv. 2017-01-19 00:58:43 +01:00
hcube.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
lockt.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
longjmp.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
privates.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
privates2.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
qlockt0.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
qlockt1.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
qlockt2.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rlockt0.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rlockt1.c qa: increase rlockt1 timeout 2017-08-14 18:46:23 +02:00
rlockt2.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rsleept0.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rsleept1.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rsleept2.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rwakeup0.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
rwakeup1.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
sleep.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
sleep2.c qa: libc: slow note handlers cant't break sleep 2017-08-16 00:37:39 +02:00
sqrt.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
sysfatal.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
va_copy.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
vseprint.c libc: introduce "jehanne_" namespace 2017-04-19 23:48:21 +02:00
wlockt0.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
wlockt1.c qa: various fix to tests 2017-08-11 03:18:32 +02:00
wlockt2.c qa: various fix to tests 2017-08-11 03:18:32 +02:00