Skip to content

Commit

Permalink
Release pledge v1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Oct 7, 2022
1 parent 05197af commit 7d6835c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions libc/calls/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,27 @@
*
* This function changes the current file position. For documentation
* on file position behaviors and gotchas, see the lseek() function.
* This function may be used on socket file descriptors, including on
* Windows.
*
* @param fd is something open()'d earlier
* @param buf is copied into, cf. copy_file_range(), sendfile(), etc.
* @param size in range [1..0x7ffff000] is reasonable
* @return [1..size] bytes on success, 0 on EOF, or -1 w/ errno; with
* exception of size==0, in which case return zero means no error
* @raise EBADF if `fd` is negative or not an open file descriptor
* @raise EBADF if `fd` is open in `O_WRONLY` mode
* @raise EFAULT if `size` is nonzero and `buf` points to bad memory
* @raise EPERM if pledge() is in play without the stdio promise
* @raise EIO if low-level i/o error happened
* @raise EINTR if signal was delivered instead
* @raise ENOTCONN if `fd` is a socket and it isn't connected
* @raise ECONNRESET if socket peer forcibly closed connection
* @raise ETIMEDOUT if socket transmission timeout occurred
* @raise EAGAIN if `O_NONBLOCK` is in play and read needs to block,
* or `SO_RCVTIMEO` is in play and the time interval elapsed
* @raise ENOBUFS is specified by POSIX
* @raise ENXIO is specified by POSIX
* @asyncsignalsafe
* @restartable
* @vforksafe
Expand Down
2 changes: 2 additions & 0 deletions libc/calls/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*
* This function changes the current file position. For documentation
* on file position behaviors and gotchas, see the lseek() function.
* This function may be used on socket file descriptors, including on
* Windows.
*
* @param fd is open file descriptor
* @param buf is copied from, cf. copy_file_range(), sendfile(), etc.
Expand Down
4 changes: 2 additions & 2 deletions tool/build/pledge.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/mem/copyfd.internal.h"
#include "libc/calls/landlock.h"
#include "libc/calls/pledge.h"
#include "libc/calls/pledge.internal.h"
Expand All @@ -40,6 +39,7 @@
#include "libc/intrin/safemacros.internal.h"
#include "libc/macros.internal.h"
#include "libc/math.h"
#include "libc/mem/copyfd.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/kcpuids.h"
Expand Down Expand Up @@ -115,7 +115,7 @@ usage: pledge.com [-hnN] PROG ARGS...\n\
- vminfo: allows /proc/stat, /proc/self/maps, etc.\n\
- tmppath: allows /tmp, $TMPPATH, lstat, unlink\n\
\n\
pledge.com v1.7\n\
pledge.com v1.8\n\
copyright 2022 justine alexandra roberts tunney\n\
https://twitter.com/justinetunney\n\
https://linkedin.com/in/jtunney\n\
Expand Down

0 comments on commit 7d6835c

Please sign in to comment.