📄 bsd.hhf
字号:
lwpid_t :dword; mode_t :word; nl_item :dword; nlink_t :word; rlim_t :qword; off_t :qword; pid_t :int32; sa_family_t :byte; size_t :dword; socklen_t :dword; suseconds_t :dword; time_t :dword; timer_t :dword; uid_t :int32; useconds_t :dword; sigset_t :union __bits :dword[4]; __lword :lword; __cset :cset; endunion; timeval: record tv_sec :time_t; tv_usec :suseconds_t; endrecord; timespec: record tv_sec :time_t; tv_nsec :dword; endrecord; timezone: record tz_minuteswest :int32; tz_dsttime :int32; endrecord; sigval :union /* Members as suggested by Annex C of POSIX 1003.1b. */ sigval_int :dword; sigval_ptr :pointer to byte; endunion; sigevent :record sigev_notify :dword; __sigev_u:union __sigev_signo :dword; /* Signal number */ __sigev_notify_kqueue :dword; endunion; sigev_value :sigval; /* Signal value */ endrecord; siginfo_t :record si_signo :dword; /* signal number */ si_errno :dword; /* errno association */ /* * Cause of signal, one of the SI_ macros or signal-specific * values, i.e. one of the FPE_... values for SIGFPE. This * value is equivalent to the second argument to an old-style * FreeBSD signal handler. */ si_code :dword; /* signal code */ si_pid :pid_t; /* sending process */ si_uid :uid_t; /* sender's ruid */ si_status :int32; /* exit value */ si_addr :dword; /* faulting instruction */ si_value :sigval; /* signal value */ si_band :dword; /* band event for SIGPOLL */ __spare__ :dword[7]; /* gimme some slack */ endrecord; stack_t :record ss_sp :dword; /* signal stack base */ ss_size :size_t; /* signal stack length */ ss_flags :dword; /* SS_DISABLE and/or SS_ONSTACK */ endrecord; mcontext_t :record /* * The first 20 fields must match the definition of * sigcontext. So that we can support sigcontext * and ucontext_t at the same time. */ mc_onstack :dword; /* XXX - sigcontext compat. */ mc_gs :dword; /* machine state (struct trapframe) */ mc_fs :dword; mc_es :dword; mc_ds :dword; mc_edi :dword; mc_esi :dword; mc_ebp :dword; mc_isp :dword; mc_ebx :dword; mc_edx :dword; mc_ecx :dword; mc_eax :dword; mc_trapno :dword; mc_err :dword; mc_eip :dword; mc_cs :dword; mc_eflags :dword; mc_esp :dword; mc_ss :dword; mc_len :dword; /* sizeof(mcontext_t) */ mc_fpformat :dword; mc_ownedfp :dword; mc_spare1 :dword; /* align next field to 16 bytes */ /* * See <machine/npx.h> for the internals of mc_fpstate[]. */ mc_fpstate :dword[128]; mc_spare2 :dword[8]; endrecord; ucontext_t :record /* * Keep the order of the first two fields. Also, * keep them the first two fields in the structure. * This way we can have a union with struct * sigcontext and ucontext_t. This allows us to * support them both at the same time. * note: the union is not defined, though. */ uc_sigmask :sigset_t; uc_mcontext :mcontext_t; uc_link :pointer to ucontext_t; uc_stack :stack_t; uc_flags :dword; __spare__ :dword[4]; endrecord; __sa_handler_t :procedure( sig:dword ); __sa_sigaction_t :procedure( sig:dword; var act:siginfo_t; var uap:ucontext_t ); sigaction_t :record __sa_sigaction :__sa_sigaction_t; sa_flags :dword; sa_mask :sigset_t; endrecord; stat_t :record st_dev :dev_t; /* inode's device */ st_ino :ino_t; /* inode's number */ st_mode :mode_t; /* inode protection mode */ st_nlink :nlink_t; /* number of hard links */ st_uid :uid_t; /* user ID of the file's owner */ st_gid :gid_t; /* group ID of the file's group */ st_rdev :dev_t; /* device type */ st_atimespec :timespec; /* time of last access */ st_mtimespec :timespec; /* time of last data modification */ st_ctimespec :timespec; /* time of last file status change */ st_size :off_t; /* file size, in bytes */ st_blocks :blkcnt_t; /* blocks allocated for file */ st_blksize :blksize_t; /* optimal blocksize for I/O */ st_flags :fflags_t; /* user defined flags for file */ st_gen :uns32; /* file generation number */ st_lspare :dword; st_birthtimespec :timespec; /* time of file creation */ align(16); endrecord; nstat :record st_dev :dev_t; /* inode's device */ st_ino :ino_t; /* inode's number */ st_mode :uns32; /* inode protection mode */ st_nlink :uns32; /* number of hard links */ st_uid :uid_t; /* user ID of the file's owner */ st_gid :gid_t; /* group ID of the file's group */ st_rdev :dev_t; /* device type */ st_atimespec :timespec; /* time of last access */ st_mtimespec :timespec; /* time of last data modification */ st_ctimespec :timespec; /* time of last file status change */ st_size :off_t; /* file size, in bytes */ st_blocks :blkcnt_t; /* blocks allocated for file */ st_blksize :blksize_t; /* optimal blocksize for I/O */ st_flags :fflags_t; /* user defined flags for file */ st_gen :uns32; /* file generation number */ st_birthtimespec :timespec; /* time of file creation */ align(16); endrecord; /* * Advisory file segment locking data type - * information passed to system by user */ flock :record l_start :off_t; l_len :off_t; l_pid :pid_t; l_type :word; l_whence:word; endrecord; env87 :record en_cw :word; /* control word (16bits) */ _pad0 :word; en_sw :word; /* status word (16bits) */ _pad1 :word; en_tw :word; /* tag word (16bits) */ _pad2 :word; en_fip :dword; /* floating point instruction pointer */ en_fcs :word; /* floating code segment selector */ en_opcode :word; /* opcode last executed (11 bits ) */ en_foo :dword; /* floating operand offset */ en_fos :dword; /* floating operand segment selector */ endrecord; save87 :record sv_env :env87; /* floating point control/status */ sv_ac :real80[8]; /* accumulator contents, 0-7 */ sv_pad0 :byte[4]; /* padding for (now unused) saved status word */ /* * Bogus padding for emulators. Emulators should use their own * struct and arrange to store into this struct (ending here) * before it is inspected for ptracing or for core dumps. Some * emulators overwrite the whole struct. We have no good way of * knowing how much padding to leave. Leave just enough for the * GPL emulator's i387_union (176 bytes total). */ sv_pad :byte[64]; /* padding; used by emulators */ endrecord; envxmm :record en_cw :word; /* control word (16bits) */ en_sw :word; /* status word (16bits) */ en_tw :word; /* tag word (16bits) */ en_opcode :word; /* opcode last executed (11 bits ) */ en_fip :dword; /* floating point instruction pointer */ en_fcs :word; /* floating code segment selector */ en_pad0 :word; /* padding */ en_foo :dword; /* floating operand offset */ en_fos :word; /* floating operand segment selector */ en_pad1 :word; /* padding */ en_mxcsr :dword; /* SSE sontorol/status register */ en_mxcsr_mask :dword; /* valid bits in mxcsr */ endrecord; fpitem :record fpacc :real80; align(16); endrecord; savexmm :record sv_env :envxmm; sv_fp :fpitem[8]; sv_xmm :lword[8]; sv_pad :byte[224]; align(16); endrecord; savefpu :union sv_87 :save87; sv_xmm :savexmm; endunion; dirent :record d_fileno :dword; /* file number of entry */ d_reclen :word; /* length of this record */ d_type :byte; /* file type, see consts above */ d_namlen :byte; /* length of string in d_name */ d_name :char[MAXNAMLEN + 1]; /* name must be no longer than this */ endrecord;procedure chdir( path:string ); @external( "BSD_CHDIR" );procedure close( fd:dword ); @external( "BSD_CLOSE" );procedure execve( path:string; var argv:var; var envp:var ); @external( "BSD_EXECVE" ); procedure _exit( exitCode:dword ); @external( "BSD_EXIT" ); procedure fork; @external( "BSD_FORK" ); procedure fstat( fd:dword; var sb:stat_t ); @external( "BSD_FSTAT" ); procedure fsync( fd:dword ); @external( "BSD_FSYNC" );procedure ftruncate( fd:dword; length:off_t ); @external( "BSD_FTRUNCATE" );procedure getcwd( var buf:var; size:size_t ); @external( "BSD_GETCWD" ); procedure getdents( fd:dword; var buf:var; nbytes:dword ); @external( "BSD_GETDENTS" ); procedure getdirentries( fd:dword; var buf:var; nbytes:dword; var basep:dword ); @external( "BSD_GETDIRENTRIES" ); procedure gettimeofday( var tv:timeval; var tz:timezone ); @external( "BSD_GETTIMEOFDAY" ); procedure lseek( fd:dword; offset:off_t; whence:dword ); @external( "BSD_LSEEK" );procedure lstat( path:string; var sb:stat_t ); @external( "BSD_LSTAT" ); procedure mkdir( path:string; mode:mode_t ); @external( "BSD_MKDIR" ); procedure mmap( addr :dword; len :size_t; prot :dword; flags :dword; fd :dword; offset :off_t ); @external( "BSD_MMAP" );procedure munmap( addr:dword; len:size_t ); @external( "BSD_MUNMAP" );procedure nanosleep( var rgtp:timespec; var rmtp:timespec ); @external( "BSD_NANOSLEEP" );const open :text := "bsd.open3";procedure open2( path:string; flags:dword ); @external( "BSD_OPEN2" );procedure open3( path:string; flags:dword; mode:mode_t ); @external( "BSD_OPEN3" ); procedure pread( fd:dword; var buf:var; len:size_t; offset:off_t ); @external( "BSD_PREAD" );procedure read( fd:dword; var buf:var; len:dword ); @external( "BSD_READ" );procedure rename( from:string; toName:string ); @external( "BSD_RENAME" );procedure rmdir( path:string ); @external( "BSD_RMDIR" );procedure sigaction( sig :dword; var act :sigaction_t; var oact :sigaction_t); @external( "BSD_SIGACTION" );procedure sigprocmask( how:dword; var newSet:sigset_t; var oldSet:sigset_t); @external( "BSD_SIGPROCMASK" );procedure stat( path:string; var sb:stat_t ); @external( "BSD_STAT" ); procedure truncate( path:string; length:off_t ); @external( "BSD_TRUNCATE" );procedure unlink( path:string ); @external( "BSD_UNLINK" );procedure waitpid( pid :pid_t; var stat_addr :dword; options :dword ); @external( "BSD_WAITPID" ); procedure write( fd:dword; var buf:var; len:dword ); @external( "BSD_WRITE" ); end bsd;#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -