X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fos.h;h=9dd1649c0e456282889d6dae83132e04a57f78f0;hb=0285aa5ff8416027932daa001b84429be2ca559b;hp=3cf3f2d13f0df44e21e612420fc05904d4c90375;hpb=2c6105acde389717317e725854d7dd3b3d6ece5c;p=sbcl.git diff --git a/src/runtime/os.h b/src/runtime/os.h index 3cf3f2d..9dd1649 100644 --- a/src/runtime/os.h +++ b/src/runtime/os.h @@ -144,17 +144,10 @@ sigset_t *os_context_sigmask_addr(os_context_t *context); /* These are not architecture-specific functions, but are instead * general utilities defined in terms of the architecture-specific * function os_validate(..) and os_invalidate(..). - * - * FIXME: os_reallocate(..) is complicated and seems no longer to be - * used for anything. Perhaps we could delete it? */ + */ extern os_vm_address_t os_allocate(os_vm_size_t len); -extern os_vm_address_t os_allocate_at(os_vm_address_t addr, os_vm_size_t len); -extern os_vm_address_t os_reallocate(os_vm_address_t addr, - os_vm_size_t old_len, - os_vm_size_t len); extern void os_deallocate(os_vm_address_t addr, os_vm_size_t len); - /* FIXME: The os_trunc_foo(..) and os_round_foo(..) macros here could * be functions. */ @@ -179,4 +172,38 @@ extern void os_deallocate(os_vm_address_t addr, os_vm_size_t len); * to return the value in a way that Lisp can understand. */ int os_get_errno(void); +/* Return an absolute path to the runtime executable, or NULL if this + * information is unavailable. Unless external_path is non-zero the + * returned path may only be valid for the current process, ie: + * something like /proc/curproc/file. If a non-null pathname is + * returned, it must be 'free'd. */ +extern char *os_get_runtime_executable_path(int external_path); + +/* Write platforms specific ones when necessary. This is to get us off + * the ground. */ +#if N_WORD_BITS == 32 +# define OS_VM_SIZE_FMT "u" +# define OS_VM_SIZE_FMTX "x" +#else +# define OS_VM_SIZE_FMT "lu" +# define OS_VM_SIZE_FMTX "lx" +#endif + +/* FIXME: this is not the right place for this, but here we have + * a convenient base type to hand. If it turns out we can just use + * size_t everywhere, this can more to runtime.h. */ +typedef os_vm_size_t word_t; +#define WORD_FMTX OS_VM_SIZE_FMTX + +#ifdef LISP_FEATURE_SB_THREAD +# ifndef CANNOT_USE_POSIX_SEM_T +# include + typedef sem_t os_sem_t; +# endif + void os_sem_init(os_sem_t *sem, unsigned int value); + void os_sem_wait(os_sem_t *sem, char *what); + void os_sem_post(os_sem_t *sem, char *what); + void os_sem_destroy(os_sem_t *sem); +#endif + #endif