+2021-06-22 Mike Frysinger <vapier@gentoo.org>
+
+ * sim/callback.h (struct host_callback_struct): Add getpid.
+
2021-05-14 Mike Frysinger <vapier@gentoo.org>
* sim/callback.h (struct host_callback_struct): Change lseek return and
int (*to_lstat) (host_callback *, const char *, struct stat *);
int (*ftruncate) (host_callback *, int, int64_t);
int (*truncate) (host_callback *, const char *, int64_t);
+ int (*getpid) (host_callback *);
int (*pipe) (host_callback *, int *);
/* Called by the framework when a read call has emptied a pipe buffer. */
+2021-06-22 Mike Frysinger <vapier@gentoo.org>
+
+ * callback.c (os_getpid): New function.
+ (default_callback): Add os_getpid.
+ * syscall.c (cb_syscall): Change getpid to cb->getpid.
+
2021-06-22 Mike Frysinger <vapier@gentoo.org>
* Make-common.in (VPATH): Use $(srcdir).
#endif
}
+static int
+os_getpid (host_callback *p)
+{
+ int result;
+
+ result = getpid ();
+ /* POSIX says getpid always succeeds. */
+ p->last_errno = 0;
+ return result;
+}
+
static int
os_pipe (host_callback *p, int *filedes)
{
os_ftruncate,
os_truncate,
+ os_getpid,
+
os_pipe,
os_pipe_empty,
os_pipe_nonempty,
break;
case CB_SYS_getpid:
- result = getpid ();
+ /* POSIX says getpid always succeeds. */
+ result = (*cb->getpid) (cb);
break;
case CB_SYS_time :