add prestat struct

This commit is contained in:
dcode
2019-03-29 01:43:39 +01:00
parent 8a7cb4c313
commit 11d9552fce
3 changed files with 59 additions and 2 deletions

View File

@ -164,7 +164,7 @@ export declare function fd_prestat_get(
/** Input: The file descriptor about which to retrieve information. */
fd: fd,
/** Input: The buffer where the description is stored. */
buf: usize // TODO: struct<prestat>
buf: struct<prestat>
): errno;
/** Return a description of the given preopened file descriptor. */
@ -1085,6 +1085,23 @@ export namespace oflags {
}
export type oflags = u16;
// TODO: undocumented
export namespace preopentype {
@inline
export const DIR: preopentype = 0;
}
export type preopentype = u8;
// TODO: undocumented
export abstract class prestat {
type: preopentype;
}
// TODO: undocumented
export class dirprestat extends prestat {
name_len: usize;
}
/** Flags provided to `sock_recv`. */
export namespace riflags {
/** Returns the message without removing it from the socket's receive queue. */