summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Martin <phy1729@gmail.com>2022-03-31 17:40:22 -0500
committerMatthew Martin <phy1729@gmail.com>2022-03-31 17:40:41 -0500
commit95749e9e652849215b5d09c5aaf8928056c41688 (patch)
tree3ad81b6793a7c606d2f2a9cebb645cb9490f4ec6
parent9e0303b044b37fc4bffd7ae4375bc6026d06f342 (diff)
downloadzsh-95749e9e652849215b5d09c5aaf8928056c41688.tar.gz
zsh-95749e9e652849215b5d09c5aaf8928056c41688.tar.xz
zsh-95749e9e652849215b5d09c5aaf8928056c41688.zip
49933: Add nonblock to sysopen
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/mod_system.yo3
-rw-r--r--Src/Modules/system.c5
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7e97c79f0..a4f74a581 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2022-03-31  Matthew Martin  <phy1729@gmail.com>
 
+	* 49933: Doc/Zsh/mod_system.yo, Src/Modules/system.c: Add
+	nonblock to sysopen.
+
 	* 49932: Completion/Zsh/Context/_brace_parameter: Update
 	_brace_parameter # description.
 
diff --git a/Doc/Zsh/mod_system.yo b/Doc/Zsh/mod_system.yo
index 399b6fe03..884c3e753 100644
--- a/Doc/Zsh/mod_system.yo
+++ b/Doc/Zsh/mod_system.yo
@@ -62,6 +62,9 @@ suppress updating of the file atime
 item(tt(nofollow))(
 fail if var(file) is a symbolic link
 )
+item(tt(nonblock))(
+the file is opened in nonblocking mode
+)
 item(tt(sync))(
 request that writes wait until data has been physically written
 )
diff --git a/Src/Modules/system.c b/Src/Modules/system.c
index ecd4e2546..71745548f 100644
--- a/Src/Modules/system.c
+++ b/Src/Modules/system.c
@@ -280,7 +280,7 @@ bin_syswrite(char *nam, char **args, Options ops, UNUSED(int func))
 }
 
 
-static struct { char *name; int oflag; } openopts[] = {
+static struct { const char *name; int oflag; } openopts[] = {
 #ifdef O_CLOEXEC
     { "cloexec", O_CLOEXEC },
 #else
@@ -297,6 +297,9 @@ static struct { char *name; int oflag; } openopts[] = {
 #ifdef O_NOATIME
     { "noatime", O_NOATIME },
 #endif
+#ifdef O_NONBLOCK
+    { "nonblock", O_NONBLOCK},
+#endif
     { "excl", O_EXCL | O_CREAT },
     { "creat", O_CREAT },
     { "create", O_CREAT },