mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
kboot: Implement dup(2)
Early in boot, we need to create the normal stdin/out/err env for the boot loader to run in. To do that, we need to open the console and duplicate the file descriptors which requires dup(2). Implement a wrapper as host_dup. Sponsored by: Netflix
This commit is contained in:
parent
a4ed0eb1aa
commit
bc84de741d
|
@ -1,4 +1,5 @@
|
|||
#define SYS_close 3
|
||||
#define SYS_dup 32
|
||||
#define SYS_getdents 78
|
||||
#define SYS_getpid 39
|
||||
#define SYS_gettimeofday 96
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#define SYS_close 6
|
||||
#define SYS_dup 41
|
||||
#define SYS_fstat 108
|
||||
#define SYS_getdents 141
|
||||
#define SYS_getpid 20
|
||||
|
|
|
@ -92,6 +92,7 @@ struct host_timeval {
|
|||
* System Calls
|
||||
*/
|
||||
int host_close(int fd);
|
||||
int host_dup(int fd);
|
||||
int host_fstat(int fd, struct host_kstat *sb);
|
||||
int host_getdents(int fd, void *dirp, int count);
|
||||
int host_getpid(void);
|
||||
|
|
|
@ -13,6 +13,12 @@ host_close(int fd)
|
|||
return host_syscall(SYS_close, fd);
|
||||
}
|
||||
|
||||
int
|
||||
host_dup(int fd)
|
||||
{
|
||||
return host_syscall(SYS_dup, fd);
|
||||
}
|
||||
|
||||
int
|
||||
host_fstat(int fd, struct host_kstat *sb)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue