summaryrefslogtreecommitdiff
path: root/src/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-10-10 19:44:32 -0400
committerIan Moffett <ian@osmora.org>2025-10-10 19:44:32 -0400
commit7c46a8f234d618d7471e6b09d480688270a33fe3 (patch)
treeb35ab6e1d9e21ab871ecc92f853e51f47aff46bf /src/sys/include
parent2c5df0dfeaf878f0f09485b7a80c79aea36d194e (diff)
kern: proc: Add getargv system call
Introduce a getargv system call that allows one to fetch an argument string using an index into the argument vector. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include')
-rw-r--r--src/sys/include/compat/unix/syscall.h3
-rw-r--r--src/sys/include/sys/proc.h5
-rw-r--r--src/sys/include/sys/syscall.h3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h
index 743e50c..2cca0bc 100644
--- a/src/sys/include/compat/unix/syscall.h
+++ b/src/sys/include/compat/unix/syscall.h
@@ -71,7 +71,8 @@ scret_t(*g_unix_sctab[])(struct syscall_args *) = {
[SYS_spawn] = sys_spawn,
[SYS_mount] = sys_mount,
[SYS_open] = sys_open,
- [SYS_muxtap] = sys_muxtap
+ [SYS_muxtap] = sys_muxtap,
+ [SYS_getargv] = sys_getargv
};
#endif /* !_NEED_UNIX_SCTAB */
diff --git a/src/sys/include/sys/proc.h b/src/sys/include/sys/proc.h
index 5bffc3e..dcf6108 100644
--- a/src/sys/include/sys/proc.h
+++ b/src/sys/include/sys/proc.h
@@ -218,5 +218,10 @@ __dead void md_proc_kick(struct proc *procp);
*/
scret_t sys_spawn(struct syscall_args *scargs);
+/*
+ * Get argument number n
+ */
+scret_t sys_getargv(struct syscall_args *scargs);
+
#endif /* !_KERNEL */
#endif /* !_SYS_PROC_H_ */
diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h
index 09996ae..8353eda 100644
--- a/src/sys/include/sys/syscall.h
+++ b/src/sys/include/sys/syscall.h
@@ -51,7 +51,8 @@
#define SYS_spawn 0x06 /* spawn a process */
#define SYS_mount 0x07 /* mount a filesystem */
#define SYS_open 0x08 /* open a file */
-#define SYS_muxtap 0x09 /* mux an I/O tap */
+#define SYS_muxtap 0x09 /* mux an I/O tap */
+#define SYS_getargv 0x0A /* get process argv */
typedef __ssize_t scret_t;
typedef __ssize_t scarg_t;