2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2015-04-21 19:49:37 +03:00
|
|
|
* Copyright 2004-2015, Haiku, Inc. All rights reserved.
|
2004-12-14 19:06:34 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2008-05-14 07:55:16 +04:00
|
|
|
#ifndef _SYSTEM_SYSCALLS_H
|
|
|
|
#define _SYSTEM_SYSCALLS_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-07-02 05:51:56 +04:00
|
|
|
|
2005-12-08 02:11:02 +03:00
|
|
|
#include <arch_config.h>
|
2009-07-22 02:18:39 +04:00
|
|
|
#include <DiskDeviceDefs.h>
|
2015-10-26 20:43:44 +03:00
|
|
|
#include <elf_private.h>
|
2003-01-12 19:17:09 +03:00
|
|
|
#include <image.h>
|
2016-04-27 02:56:42 +03:00
|
|
|
#include <image_defs.h>
|
2005-12-08 02:11:02 +03:00
|
|
|
#include <OS.h>
|
2004-10-29 05:27:44 +04:00
|
|
|
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
#include <signal.h>
|
2008-04-11 08:12:23 +04:00
|
|
|
#include <sys/socket.h>
|
2004-12-14 19:06:34 +03:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-07-29 04:34:44 +04:00
|
|
|
struct attr_info;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct dirent;
|
2006-01-17 04:29:18 +03:00
|
|
|
struct fd_info;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct fd_set;
|
|
|
|
struct fs_info;
|
|
|
|
struct iovec;
|
2008-09-11 19:03:01 +04:00
|
|
|
struct msqid_ds;
|
2008-04-11 08:12:23 +04:00
|
|
|
struct net_stat;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct pollfd;
|
2004-07-02 05:51:56 +04:00
|
|
|
struct rlimit;
|
2008-09-03 19:10:44 +04:00
|
|
|
struct scheduling_analysis;
|
2008-06-19 04:05:01 +04:00
|
|
|
struct _sem_t;
|
2008-07-29 16:03:41 +04:00
|
|
|
struct sembuf;
|
|
|
|
union semun;
|
2009-04-18 21:35:28 +04:00
|
|
|
struct sigaction;
|
2011-06-12 04:00:23 +04:00
|
|
|
struct signal_frame_data;
|
2009-04-18 21:35:28 +04:00
|
|
|
struct stat;
|
|
|
|
struct system_profiler_parameters;
|
2011-06-12 04:00:23 +04:00
|
|
|
struct user_timer_info;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
|
|
|
|
struct disk_device_job_progress_info;
|
|
|
|
struct partitionable_space_data;
|
2008-05-09 05:32:36 +04:00
|
|
|
struct thread_creation_attributes;
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct user_disk_device_data;
|
|
|
|
struct user_disk_device_job_info;
|
|
|
|
struct user_disk_system_info;
|
2004-07-02 05:51:56 +04:00
|
|
|
|
2004-08-29 00:29:35 +04:00
|
|
|
// This marks the beginning of the syscalls prototypes for gensyscallinfos.
|
|
|
|
// NOTE:
|
|
|
|
// * Nothing but those prototypes may live here.
|
|
|
|
// * The arguments of the functions must be named to be processed properly.
|
2004-11-26 00:18:54 +03:00
|
|
|
|
2004-08-29 00:29:35 +04:00
|
|
|
#ifdef GEN_SYSCALL_INFOS_PROCESSING
|
2009-11-26 19:59:46 +03:00
|
|
|
# define __NO_RETURN
|
|
|
|
# pragma syscalls begin
|
|
|
|
#else
|
|
|
|
# define __NO_RETURN __attribute__((noreturn))
|
2004-08-29 00:29:35 +04:00
|
|
|
#endif
|
2004-07-02 05:51:56 +04:00
|
|
|
|
2007-02-05 00:08:35 +03:00
|
|
|
extern int _kern_is_computer_on(void);
|
2004-12-14 20:09:06 +03:00
|
|
|
extern status_t _kern_generic_syscall(const char *subsystem, uint32 function,
|
2004-12-14 18:46:53 +03:00
|
|
|
void *buffer, size_t bufferSize);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-03-03 03:52:47 +03:00
|
|
|
extern int _kern_getrlimit(int resource, struct rlimit * rlp);
|
|
|
|
extern int _kern_setrlimit(int resource, const struct rlimit * rlp);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-11-25 20:57:37 +03:00
|
|
|
extern status_t _kern_shutdown(bool reboot);
|
2008-07-29 16:03:41 +04:00
|
|
|
extern status_t _kern_get_safemode_option(const char *parameter,
|
|
|
|
char *buffer, size_t *_bufferSize);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-10-02 23:47:31 +04:00
|
|
|
extern ssize_t _kern_wait_for_objects(object_wait_info* infos, int numInfos,
|
|
|
|
uint32 flags, bigtime_t timeout);
|
|
|
|
|
2010-04-11 20:07:39 +04:00
|
|
|
/* user mutex functions */
|
|
|
|
extern status_t _kern_mutex_lock(int32* mutex, const char* name,
|
|
|
|
uint32 flags, bigtime_t timeout);
|
|
|
|
extern status_t _kern_mutex_unlock(int32* mutex, uint32 flags);
|
|
|
|
extern status_t _kern_mutex_switch_lock(int32* fromMutex, int32* toMutex,
|
|
|
|
const char* name, uint32 flags, bigtime_t timeout);
|
2015-05-11 23:14:52 +03:00
|
|
|
extern status_t _kern_mutex_sem_acquire(int32* sem, const char* name,
|
|
|
|
uint32 flags, bigtime_t timeout);
|
|
|
|
extern status_t _kern_mutex_sem_release(int32* sem);
|
2010-04-11 20:07:39 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
/* sem functions */
|
2004-12-14 19:06:34 +03:00
|
|
|
extern sem_id _kern_create_sem(int count, const char *name);
|
|
|
|
extern status_t _kern_delete_sem(sem_id id);
|
2005-03-18 01:35:00 +03:00
|
|
|
extern status_t _kern_switch_sem(sem_id releaseSem, sem_id id);
|
2008-07-29 16:03:41 +04:00
|
|
|
extern status_t _kern_switch_sem_etc(sem_id releaseSem, sem_id id,
|
|
|
|
uint32 count, uint32 flags, bigtime_t timeout);
|
2004-12-14 19:06:34 +03:00
|
|
|
extern status_t _kern_acquire_sem(sem_id id);
|
2008-07-29 16:03:41 +04:00
|
|
|
extern status_t _kern_acquire_sem_etc(sem_id id, uint32 count, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2004-12-14 19:06:34 +03:00
|
|
|
extern status_t _kern_release_sem(sem_id id);
|
|
|
|
extern status_t _kern_release_sem_etc(sem_id id, uint32 count, uint32 flags);
|
|
|
|
extern status_t _kern_get_sem_count(sem_id id, int32* thread_count);
|
2008-07-29 16:03:41 +04:00
|
|
|
extern status_t _kern_get_sem_info(sem_id semaphore, struct sem_info *info,
|
|
|
|
size_t size);
|
2006-01-08 18:34:09 +03:00
|
|
|
extern status_t _kern_get_next_sem_info(team_id team, int32 *cookie,
|
2004-12-14 19:06:34 +03:00
|
|
|
struct sem_info *info, size_t size);
|
|
|
|
extern status_t _kern_set_sem_owner(sem_id id, team_id proc);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-05-06 07:39:36 +04:00
|
|
|
/* POSIX realtime sem syscalls */
|
2008-05-08 05:39:49 +04:00
|
|
|
extern status_t _kern_realtime_sem_open(const char* name,
|
|
|
|
int openFlagsOrShared, mode_t mode, uint32 semCount,
|
2008-06-19 04:05:01 +04:00
|
|
|
struct _sem_t* userSem, struct _sem_t** _usedUserSem);
|
2008-05-06 07:39:36 +04:00
|
|
|
extern status_t _kern_realtime_sem_close(sem_id semID,
|
2008-06-19 04:05:01 +04:00
|
|
|
struct _sem_t** _deleteUserSem);
|
2008-05-06 07:39:36 +04:00
|
|
|
extern status_t _kern_realtime_sem_unlink(const char* name);
|
|
|
|
|
|
|
|
extern status_t _kern_realtime_sem_get_value(sem_id semID, int* value);
|
|
|
|
extern status_t _kern_realtime_sem_post(sem_id semID);
|
2022-02-16 22:29:11 +03:00
|
|
|
extern status_t _kern_realtime_sem_wait(sem_id semID, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2008-05-06 07:39:36 +04:00
|
|
|
|
2008-07-29 16:03:41 +04:00
|
|
|
/* POSIX XSI semaphore syscalls */
|
|
|
|
extern int _kern_xsi_semget(key_t key, int numSems, int flags);
|
|
|
|
extern int _kern_xsi_semctl(int semID, int semNumber, int command,
|
|
|
|
union semun* args);
|
|
|
|
extern status_t _kern_xsi_semop(int semID, struct sembuf *semOps,
|
|
|
|
size_t numSemOps);
|
2004-03-03 03:52:47 +03:00
|
|
|
|
2008-09-11 19:03:01 +04:00
|
|
|
/* POSIX XSI message queue syscalls */
|
|
|
|
extern int _kern_xsi_msgctl(int messageQueueID, int command,
|
|
|
|
struct msqid_ds *buffer);
|
|
|
|
extern int _kern_xsi_msgget(key_t key, int messageQueueFlags);
|
|
|
|
extern ssize_t _kern_xsi_msgrcv(int messageQueueID, void *messagePointer,
|
|
|
|
size_t messageSize, long messageType, int messageFlags);
|
|
|
|
extern int _kern_xsi_msgsnd(int messageQueueID,
|
|
|
|
const void *messagePointer, size_t messageSize,
|
|
|
|
int messageFlags);
|
|
|
|
|
2008-07-29 16:03:41 +04:00
|
|
|
/* team & thread syscalls */
|
2008-06-24 07:37:07 +04:00
|
|
|
extern thread_id _kern_load_image(const char* const* flatArgs,
|
|
|
|
size_t flatArgsSize, int32 argCount, int32 envCount,
|
|
|
|
int32 priority, uint32 flags, port_id errorPort,
|
|
|
|
uint32 errorToken);
|
2009-11-26 19:59:46 +03:00
|
|
|
extern void __NO_RETURN _kern_exit_team(status_t returnValue);
|
2004-03-03 03:52:47 +03:00
|
|
|
extern status_t _kern_kill_team(team_id team);
|
|
|
|
extern team_id _kern_get_current_team();
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_wait_for_team(team_id team, status_t *_returnCode);
|
2011-06-12 04:00:23 +04:00
|
|
|
extern pid_t _kern_wait_for_child(thread_id child, uint32 flags,
|
2017-10-10 18:20:46 +03:00
|
|
|
siginfo_t* info, team_usage_info* usageInfo);
|
2008-06-24 07:37:07 +04:00
|
|
|
extern status_t _kern_exec(const char *path, const char* const* flatArgs,
|
2011-01-02 22:12:19 +03:00
|
|
|
size_t flatArgsSize, int32 argCount, int32 envCount,
|
|
|
|
mode_t umask);
|
2004-09-15 19:42:02 +04:00
|
|
|
extern thread_id _kern_fork(void);
|
2004-10-14 18:31:31 +04:00
|
|
|
extern pid_t _kern_process_info(pid_t process, int32 which);
|
|
|
|
extern pid_t _kern_setpgid(pid_t process, pid_t group);
|
|
|
|
extern pid_t _kern_setsid(void);
|
2008-03-30 09:59:54 +04:00
|
|
|
extern status_t _kern_change_root(const char *path);
|
2004-08-29 00:29:35 +04:00
|
|
|
|
2008-05-09 05:32:36 +04:00
|
|
|
extern thread_id _kern_spawn_thread(
|
|
|
|
struct thread_creation_attributes* attributes);
|
2004-03-03 03:52:47 +03:00
|
|
|
extern thread_id _kern_find_thread(const char *name);
|
|
|
|
extern status_t _kern_suspend_thread(thread_id thread);
|
|
|
|
extern status_t _kern_resume_thread(thread_id thread);
|
2004-05-24 16:12:58 +04:00
|
|
|
extern status_t _kern_rename_thread(thread_id thread, const char *newName);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_set_thread_priority(thread_id thread,
|
|
|
|
int32 newPriority);
|
2004-03-03 03:52:47 +03:00
|
|
|
extern status_t _kern_kill_thread(thread_id thread);
|
|
|
|
extern void _kern_exit_thread(status_t returnValue);
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_cancel_thread(thread_id threadID,
|
|
|
|
void (*cancelFunction)(int));
|
2006-01-31 05:29:02 +03:00
|
|
|
extern void _kern_thread_yield(void);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_wait_for_thread(thread_id thread,
|
|
|
|
status_t *_returnCode);
|
2004-03-03 03:52:47 +03:00
|
|
|
extern bool _kern_has_data(thread_id thread);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_send_data(thread_id thread, int32 code,
|
|
|
|
const void *buffer, size_t bufferSize);
|
|
|
|
extern int32 _kern_receive_data(thread_id *_sender, void *buffer,
|
|
|
|
size_t bufferSize);
|
2011-06-12 04:00:23 +04:00
|
|
|
extern int64 _kern_restore_signal_frame(
|
|
|
|
struct signal_frame_data* signalFrameData);
|
2004-03-03 03:52:47 +03:00
|
|
|
|
|
|
|
extern status_t _kern_get_thread_info(thread_id id, thread_info *info);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_get_next_thread_info(team_id team, int32 *cookie,
|
|
|
|
thread_info *info);
|
2004-03-03 03:52:47 +03:00
|
|
|
extern status_t _kern_get_team_info(team_id id, team_info *info);
|
|
|
|
extern status_t _kern_get_next_team_info(int32 *cookie, team_info *info);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_get_team_usage_info(team_id team, int32 who,
|
|
|
|
team_usage_info *info, size_t size);
|
2010-11-16 22:42:08 +03:00
|
|
|
extern status_t _kern_get_extended_team_info(team_id teamID, uint32 flags,
|
|
|
|
void* buffer, size_t size, size_t* _sizeNeeded);
|
2002-08-04 06:04:37 +04:00
|
|
|
|
2010-12-16 20:01:23 +03:00
|
|
|
extern status_t _kern_start_watching_system(int32 object, uint32 flags,
|
2010-12-16 04:49:52 +03:00
|
|
|
port_id port, int32 token);
|
2010-12-16 20:01:23 +03:00
|
|
|
extern status_t _kern_stop_watching_system(int32 object, uint32 flags,
|
2010-12-16 04:49:52 +03:00
|
|
|
port_id port, int32 token);
|
|
|
|
|
2008-05-12 17:53:56 +04:00
|
|
|
extern status_t _kern_block_thread(uint32 flags, bigtime_t timeout);
|
|
|
|
extern status_t _kern_unblock_thread(thread_id thread, status_t status);
|
|
|
|
extern status_t _kern_unblock_threads(thread_id* threads, uint32 count,
|
|
|
|
status_t status);
|
|
|
|
|
2010-04-12 00:40:58 +04:00
|
|
|
extern bigtime_t _kern_estimate_max_scheduling_latency(thread_id thread);
|
|
|
|
|
2013-11-21 02:32:40 +04:00
|
|
|
extern status_t _kern_set_scheduler_mode(int32 mode);
|
|
|
|
extern int32 _kern_get_scheduler_mode(void);
|
|
|
|
|
2008-03-11 20:12:02 +03:00
|
|
|
// user/group functions
|
|
|
|
extern gid_t _kern_getgid(bool effective);
|
|
|
|
extern uid_t _kern_getuid(bool effective);
|
|
|
|
extern status_t _kern_setregid(gid_t rgid, gid_t egid,
|
|
|
|
bool setAllIfPrivileged);
|
|
|
|
extern status_t _kern_setreuid(uid_t ruid, uid_t euid,
|
|
|
|
bool setAllIfPrivileged);
|
2008-03-30 04:08:13 +04:00
|
|
|
extern ssize_t _kern_getgroups(int groupCount, gid_t* groupList);
|
|
|
|
extern status_t _kern_setgroups(int groupCount, const gid_t* groupList);
|
2008-03-11 20:12:02 +03:00
|
|
|
|
2004-09-01 16:02:26 +04:00
|
|
|
// signal functions
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_send_signal(int32 id, uint32 signal,
|
|
|
|
const union sigval* userValue, uint32 flags);
|
|
|
|
extern status_t _kern_set_signal_mask(int how, const sigset_t *set,
|
2007-08-16 22:01:47 +04:00
|
|
|
sigset_t *oldSet);
|
|
|
|
extern status_t _kern_sigaction(int sig, const struct sigaction *action,
|
|
|
|
struct sigaction *oldAction);
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_sigwait(const sigset_t *set, siginfo_t *info,
|
|
|
|
uint32 flags, bigtime_t timeout);
|
2007-08-16 22:01:47 +04:00
|
|
|
extern status_t _kern_sigsuspend(const sigset_t *mask);
|
|
|
|
extern status_t _kern_sigpending(sigset_t *set);
|
|
|
|
extern status_t _kern_set_signal_stack(const stack_t *newStack,
|
|
|
|
stack_t *oldStack);
|
2002-10-23 21:31:10 +04:00
|
|
|
|
2003-01-12 19:17:09 +03:00
|
|
|
// image functions
|
2016-04-27 02:56:42 +03:00
|
|
|
extern image_id _kern_register_image(extended_image_info *info,
|
|
|
|
size_t size);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_unregister_image(image_id id);
|
2005-03-12 17:58:39 +03:00
|
|
|
extern void _kern_image_relocated(image_id id);
|
|
|
|
extern void _kern_loading_app_failed(status_t error);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_get_image_info(image_id id, image_info *info,
|
|
|
|
size_t size);
|
|
|
|
extern status_t _kern_get_next_image_info(team_id team, int32 *cookie,
|
|
|
|
image_info *info, size_t size);
|
2008-09-22 15:13:38 +04:00
|
|
|
extern status_t _kern_read_kernel_image_symbols(image_id id,
|
2012-08-07 23:20:42 +04:00
|
|
|
elf_sym* symbolTable, int32* _symbolCount,
|
2008-09-22 15:13:38 +04:00
|
|
|
char* stringTable, size_t* _stringTableSize,
|
|
|
|
addr_t* _imageDelta);
|
2004-07-02 05:51:56 +04:00
|
|
|
|
|
|
|
// VFS functions
|
2005-10-17 18:01:04 +04:00
|
|
|
extern dev_t _kern_mount(const char *path, const char *device,
|
2009-06-19 12:23:11 +04:00
|
|
|
const char *fs_name, uint32 flags, const char *args,
|
|
|
|
size_t argsLength);
|
2004-11-30 01:42:01 +03:00
|
|
|
extern status_t _kern_unmount(const char *path, uint32 flags);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_read_fs_info(dev_t device, struct fs_info *info);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_write_fs_info(dev_t device, const struct fs_info *info,
|
|
|
|
int mask);
|
2004-07-07 20:07:25 +04:00
|
|
|
extern dev_t _kern_next_device(int32 *_cookie);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_sync(void);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_entry_ref_to_path(dev_t device, ino_t inode,
|
|
|
|
const char *leaf, char *userPath, size_t pathLength);
|
2008-02-08 06:06:14 +03:00
|
|
|
extern status_t _kern_normalize_path(const char* userPath,
|
|
|
|
bool traverseLink, char* buffer);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern int _kern_open_entry_ref(dev_t device, ino_t inode,
|
|
|
|
const char *name, int openMode, int perms);
|
|
|
|
extern int _kern_open(int fd, const char *path, int openMode,
|
|
|
|
int perms);
|
|
|
|
extern int _kern_open_dir_entry_ref(dev_t device, ino_t inode,
|
|
|
|
const char *name);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern int _kern_open_dir(int fd, const char *path);
|
|
|
|
extern int _kern_open_parent_dir(int fd, char *name,
|
|
|
|
size_t nameLength);
|
2012-07-21 17:33:27 +04:00
|
|
|
extern status_t _kern_fcntl(int fd, int op, size_t argument);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_fsync(int fd);
|
2008-02-03 18:37:31 +03:00
|
|
|
extern status_t _kern_flock(int fd, int op);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern off_t _kern_seek(int fd, off_t pos, int seekType);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_create_dir_entry_ref(dev_t device, ino_t inode,
|
|
|
|
const char *name, int perms);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_create_dir(int fd, const char *path, int perms);
|
2006-01-25 14:12:21 +03:00
|
|
|
extern status_t _kern_remove_dir(int fd, const char *path);
|
2005-04-06 20:07:10 +04:00
|
|
|
extern status_t _kern_read_link(int fd, const char *path, char *buffer,
|
|
|
|
size_t *_bufferSize);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_create_symlink(int fd, const char *path,
|
|
|
|
const char *toPath, int mode);
|
2009-11-26 19:30:16 +03:00
|
|
|
extern status_t _kern_create_link(int pathFD, const char *path, int toFD,
|
|
|
|
const char *toPath, bool traverseLeafLink);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_unlink(int fd, const char *path);
|
|
|
|
extern status_t _kern_rename(int oldDir, const char *oldpath, int newDir,
|
|
|
|
const char *newpath);
|
2009-11-26 19:17:17 +03:00
|
|
|
extern status_t _kern_create_fifo(int fd, const char *path, mode_t perms);
|
2008-04-06 06:49:12 +04:00
|
|
|
extern status_t _kern_create_pipe(int *fds);
|
2009-11-26 19:17:17 +03:00
|
|
|
extern status_t _kern_access(int fd, const char *path, int mode,
|
|
|
|
bool effectiveUserGroup);
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
extern ssize_t _kern_select(int numfds, struct fd_set *readSet,
|
|
|
|
struct fd_set *writeSet, struct fd_set *errorSet,
|
2004-07-02 05:51:56 +04:00
|
|
|
bigtime_t timeout, const sigset_t *sigMask);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern ssize_t _kern_poll(struct pollfd *fds, int numFDs,
|
2021-06-18 21:01:13 +03:00
|
|
|
bigtime_t timeout, const sigset_t *sigMask);
|
2009-07-29 04:34:44 +04:00
|
|
|
|
2011-08-11 01:08:00 +04:00
|
|
|
extern int _kern_open_attr_dir(int fd, const char *path,
|
|
|
|
bool traverseLeafLink);
|
2009-07-29 04:34:44 +04:00
|
|
|
extern ssize_t _kern_read_attr(int fd, const char *attribute, off_t pos,
|
|
|
|
void *buffer, size_t readBytes);
|
|
|
|
extern ssize_t _kern_write_attr(int fd, const char *attribute, uint32 type,
|
|
|
|
off_t pos, const void *buffer, size_t readBytes);
|
|
|
|
extern status_t _kern_stat_attr(int fd, const char *attribute,
|
|
|
|
struct attr_info *attrInfo);
|
|
|
|
extern int _kern_open_attr(int fd, const char* path, const char *name,
|
|
|
|
uint32 type, int openMode);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_remove_attr(int fd, const char *name);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_rename_attr(int fromFile, const char *fromName,
|
|
|
|
int toFile, const char *toName);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern int _kern_open_index_dir(dev_t device);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_create_index(dev_t device, const char *name,
|
|
|
|
uint32 type, uint32 flags);
|
|
|
|
extern status_t _kern_read_index_stat(dev_t device, const char *name,
|
|
|
|
struct stat *stat);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_remove_index(dev_t device, const char *name);
|
|
|
|
extern status_t _kern_getcwd(char *buffer, size_t size);
|
|
|
|
extern status_t _kern_setcwd(int fd, const char *path);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern int _kern_open_query(dev_t device, const char *query,
|
|
|
|
size_t queryLength, uint32 flags, port_id port,
|
|
|
|
int32 token);
|
2004-07-02 05:51:56 +04:00
|
|
|
|
|
|
|
// file descriptor functions
|
2009-06-19 12:23:11 +04:00
|
|
|
extern ssize_t _kern_read(int fd, off_t pos, void *buffer,
|
|
|
|
size_t bufferSize);
|
|
|
|
extern ssize_t _kern_readv(int fd, off_t pos, const struct iovec *vecs,
|
|
|
|
size_t count);
|
|
|
|
extern ssize_t _kern_write(int fd, off_t pos, const void *buffer,
|
|
|
|
size_t bufferSize);
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
extern ssize_t _kern_writev(int fd, off_t pos, const struct iovec *vecs,
|
|
|
|
size_t count);
|
2010-05-25 01:04:22 +04:00
|
|
|
extern status_t _kern_ioctl(int fd, uint32 cmd, void *data, size_t length);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern ssize_t _kern_read_dir(int fd, struct dirent *buffer,
|
|
|
|
size_t bufferSize, uint32 maxCount);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_rewind_dir(int fd);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_read_stat(int fd, const char *path, bool traverseLink,
|
|
|
|
struct stat *stat, size_t statSize);
|
|
|
|
extern status_t _kern_write_stat(int fd, const char *path,
|
|
|
|
bool traverseLink, const struct stat *stat,
|
|
|
|
size_t statSize, int statMask);
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_close(int fd);
|
|
|
|
extern int _kern_dup(int fd);
|
|
|
|
extern int _kern_dup2(int ofd, int nfd);
|
2004-08-29 00:29:35 +04:00
|
|
|
extern status_t _kern_lock_node(int fd);
|
|
|
|
extern status_t _kern_unlock_node(int fd);
|
2006-01-17 04:29:18 +03:00
|
|
|
extern status_t _kern_get_next_fd_info(team_id team, uint32 *_cookie,
|
|
|
|
struct fd_info *info, size_t infoSize);
|
2020-11-05 22:16:42 +03:00
|
|
|
extern status_t _kern_preallocate(int fd, off_t offset, off_t length);
|
2003-01-12 19:17:09 +03:00
|
|
|
|
2008-04-11 08:12:23 +04:00
|
|
|
// socket functions
|
|
|
|
extern int _kern_socket(int family, int type, int protocol);
|
|
|
|
extern status_t _kern_bind(int socket, const struct sockaddr *address,
|
|
|
|
socklen_t addressLength);
|
|
|
|
extern status_t _kern_shutdown_socket(int socket, int how);
|
|
|
|
extern status_t _kern_connect(int socket, const struct sockaddr *address,
|
|
|
|
socklen_t addressLength);
|
|
|
|
extern status_t _kern_listen(int socket, int backlog);
|
|
|
|
extern int _kern_accept(int socket, struct sockaddr *address,
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
extern ssize_t _kern_recv(int socket, void *data, size_t length,
|
|
|
|
int flags);
|
|
|
|
extern ssize_t _kern_recvfrom(int socket, void *data, size_t length,
|
|
|
|
int flags, struct sockaddr *address,
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
extern ssize_t _kern_recvmsg(int socket, struct msghdr *message,
|
|
|
|
int flags);
|
|
|
|
extern ssize_t _kern_send(int socket, const void *data, size_t length,
|
|
|
|
int flags);
|
|
|
|
extern ssize_t _kern_sendto(int socket, const void *data, size_t length,
|
|
|
|
int flags, const struct sockaddr *address,
|
|
|
|
socklen_t addressLength);
|
|
|
|
extern ssize_t _kern_sendmsg(int socket, const struct msghdr *message,
|
|
|
|
int flags);
|
|
|
|
extern status_t _kern_getsockopt(int socket, int level, int option,
|
|
|
|
void *value, socklen_t *_length);
|
|
|
|
extern status_t _kern_setsockopt(int socket, int level, int option,
|
|
|
|
const void *value, socklen_t length);
|
|
|
|
extern status_t _kern_getpeername(int socket, struct sockaddr *address,
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
extern status_t _kern_getsockname(int socket, struct sockaddr *address,
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
extern int _kern_sockatmark(int socket);
|
|
|
|
extern status_t _kern_socketpair(int family, int type, int protocol,
|
|
|
|
int *socketVector);
|
|
|
|
extern status_t _kern_get_next_socket_stat(int family, uint32 *cookie,
|
|
|
|
struct net_stat *stat);
|
|
|
|
|
2003-01-18 17:04:22 +03:00
|
|
|
// node monitor functions
|
2004-07-02 05:51:56 +04:00
|
|
|
extern status_t _kern_stop_notifying(port_id port, uint32 token);
|
|
|
|
extern status_t _kern_start_watching(dev_t device, ino_t node, uint32 flags,
|
|
|
|
port_id port, uint32 token);
|
2007-08-01 18:48:44 +04:00
|
|
|
extern status_t _kern_stop_watching(dev_t device, ino_t node, port_id port,
|
|
|
|
uint32 token);
|
2003-01-18 17:04:22 +03:00
|
|
|
|
2003-10-28 16:30:10 +03:00
|
|
|
// time functions
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_set_real_time_clock(bigtime_t time);
|
2010-08-17 02:01:28 +04:00
|
|
|
extern status_t _kern_set_timezone(int32 timezoneOffset, const char *name,
|
|
|
|
size_t nameLength);
|
|
|
|
extern status_t _kern_get_timezone(int32 *_timezoneOffset, char *name,
|
|
|
|
size_t nameLength);
|
2010-08-03 21:47:26 +04:00
|
|
|
extern status_t _kern_set_real_time_clock_is_gmt(bool isGMT);
|
|
|
|
extern status_t _kern_get_real_time_clock_is_gmt(bool *_isGMT);
|
2003-10-28 16:30:10 +03:00
|
|
|
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_get_clock(clockid_t clockID, bigtime_t* _time);
|
|
|
|
extern status_t _kern_set_clock(clockid_t clockID, bigtime_t time);
|
|
|
|
|
2004-11-25 20:57:37 +03:00
|
|
|
extern bigtime_t _kern_system_time();
|
2011-06-12 04:00:23 +04:00
|
|
|
extern status_t _kern_snooze_etc(bigtime_t time, int timebase, int32 flags,
|
|
|
|
bigtime_t* _remainingTime);
|
|
|
|
|
|
|
|
extern int32 _kern_create_timer(clockid_t clockID, thread_id threadID,
|
|
|
|
uint32 flags, const struct sigevent* event,
|
|
|
|
const struct thread_creation_attributes*
|
|
|
|
threadAttributes);
|
|
|
|
extern status_t _kern_delete_timer(int32 timerID, thread_id threadID);
|
|
|
|
extern status_t _kern_get_timer(int32 timerID, thread_id threadID,
|
|
|
|
struct user_timer_info* info);
|
|
|
|
extern status_t _kern_set_timer(int32 timerID, thread_id threadID,
|
|
|
|
bigtime_t startTime, bigtime_t interval, uint32 flags,
|
|
|
|
struct user_timer_info* oldInfo);
|
2004-11-25 20:57:37 +03:00
|
|
|
|
2003-01-12 19:17:09 +03:00
|
|
|
// area functions
|
2009-06-19 12:23:11 +04:00
|
|
|
extern area_id _kern_create_area(const char *name, void **address,
|
|
|
|
uint32 addressSpec, size_t size, uint32 lock,
|
|
|
|
uint32 protection);
|
2004-12-14 18:46:53 +03:00
|
|
|
extern status_t _kern_delete_area(area_id area);
|
|
|
|
extern area_id _kern_area_for(void *address);
|
|
|
|
extern area_id _kern_find_area(const char *name);
|
|
|
|
extern status_t _kern_get_area_info(area_id area, area_info *info);
|
2012-07-29 12:31:14 +04:00
|
|
|
extern status_t _kern_get_next_area_info(team_id team, ssize_t *cookie,
|
2009-06-19 12:23:11 +04:00
|
|
|
area_info *info);
|
2004-12-14 18:46:53 +03:00
|
|
|
extern status_t _kern_resize_area(area_id area, size_t newSize);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern area_id _kern_transfer_area(area_id area, void **_address,
|
|
|
|
uint32 addressSpec, team_id target);
|
|
|
|
extern status_t _kern_set_area_protection(area_id area,
|
|
|
|
uint32 newProtection);
|
|
|
|
extern area_id _kern_clone_area(const char *name, void **_address,
|
|
|
|
uint32 addressSpec, uint32 protection,
|
|
|
|
area_id sourceArea);
|
2009-06-19 15:09:21 +04:00
|
|
|
extern status_t _kern_reserve_address_range(addr_t* _address,
|
2009-06-19 12:23:11 +04:00
|
|
|
uint32 addressSpec, addr_t size);
|
2009-06-19 15:09:21 +04:00
|
|
|
extern status_t _kern_unreserve_address_range(addr_t address, addr_t size);
|
2004-12-14 18:46:53 +03:00
|
|
|
|
2008-04-14 02:52:11 +04:00
|
|
|
extern area_id _kern_map_file(const char *name, void **address,
|
2010-05-01 23:47:39 +04:00
|
|
|
uint32 addressSpec, size_t size, uint32 protection,
|
|
|
|
uint32 mapping, bool unmapAddressRange, int fd,
|
2009-06-19 12:23:11 +04:00
|
|
|
off_t offset);
|
2008-08-08 05:00:06 +04:00
|
|
|
extern status_t _kern_unmap_memory(void *address, size_t size);
|
|
|
|
extern status_t _kern_set_memory_protection(void *address, size_t size,
|
2010-05-01 23:47:39 +04:00
|
|
|
uint32 protection);
|
2008-08-08 05:00:06 +04:00
|
|
|
extern status_t _kern_sync_memory(void *address, size_t size, int flags);
|
|
|
|
extern status_t _kern_memory_advice(void *address, size_t size,
|
2010-05-01 23:47:39 +04:00
|
|
|
uint32 advice);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2011-08-11 01:08:00 +04:00
|
|
|
extern status_t _kern_get_memory_properties(team_id teamID,
|
|
|
|
const void *address, uint32* _protected, uint32* _lock);
|
2011-06-13 00:17:14 +04:00
|
|
|
|
2019-12-14 14:24:38 +03:00
|
|
|
extern status_t _kern_mlock(const void* address, size_t size);
|
|
|
|
extern status_t _kern_munlock(const void* address, size_t size);
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
/* kernel port functions */
|
2004-12-14 18:46:53 +03:00
|
|
|
extern port_id _kern_create_port(int32 queue_length, const char *name);
|
|
|
|
extern status_t _kern_close_port(port_id id);
|
|
|
|
extern status_t _kern_delete_port(port_id id);
|
|
|
|
extern port_id _kern_find_port(const char *port_name);
|
|
|
|
extern status_t _kern_get_port_info(port_id id, struct port_info *info);
|
2015-04-10 15:57:04 +03:00
|
|
|
extern status_t _kern_get_next_port_info(team_id team, int32 *cookie,
|
2009-06-19 12:23:11 +04:00
|
|
|
struct port_info *info);
|
|
|
|
extern ssize_t _kern_port_buffer_size_etc(port_id port, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2004-12-14 18:46:53 +03:00
|
|
|
extern int32 _kern_port_count(port_id port);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern ssize_t _kern_read_port_etc(port_id port, int32 *msgCode,
|
|
|
|
void *msgBuffer, size_t bufferSize, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2004-12-14 18:46:53 +03:00
|
|
|
extern status_t _kern_set_port_owner(port_id port, team_id team);
|
2009-06-19 12:23:11 +04:00
|
|
|
extern status_t _kern_write_port_etc(port_id port, int32 msgCode,
|
|
|
|
const void *msgBuffer, size_t bufferSize, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
extern status_t _kern_writev_port_etc(port_id id, int32 msgCode,
|
|
|
|
const struct iovec *msgVecs, size_t vecCount,
|
|
|
|
size_t bufferSize, uint32 flags, bigtime_t timeout);
|
2008-04-17 21:46:02 +04:00
|
|
|
extern status_t _kern_get_port_message_info_etc(port_id port,
|
|
|
|
port_message_info *info, size_t infoSize, uint32 flags,
|
|
|
|
bigtime_t timeout);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-02-10 05:55:02 +03:00
|
|
|
// debug support functions
|
2009-07-30 16:35:42 +04:00
|
|
|
extern status_t _kern_kernel_debugger(const char *message);
|
2015-04-21 19:49:37 +03:00
|
|
|
extern void _kern_register_syslog_daemon(port_id port);
|
2005-02-10 05:55:02 +03:00
|
|
|
extern void _kern_debugger(const char *message);
|
|
|
|
extern int _kern_disable_debugger(int state);
|
|
|
|
|
|
|
|
extern status_t _kern_install_default_debugger(port_id debuggerPort);
|
|
|
|
extern port_id _kern_install_team_debugger(team_id team,
|
|
|
|
port_id debuggerPort);
|
|
|
|
extern status_t _kern_remove_team_debugger(team_id team);
|
|
|
|
extern status_t _kern_debug_thread(thread_id thread);
|
2005-03-10 01:46:31 +03:00
|
|
|
extern void _kern_wait_for_debugger(void);
|
2005-02-10 05:55:02 +03:00
|
|
|
|
2007-03-20 19:20:13 +03:00
|
|
|
extern status_t _kern_set_debugger_breakpoint(void *address, uint32 type,
|
|
|
|
int32 length, bool watchpoint);
|
|
|
|
extern status_t _kern_clear_debugger_breakpoint(void *address,
|
|
|
|
bool watchpoint);
|
2005-02-10 05:55:02 +03:00
|
|
|
|
2009-04-18 21:35:28 +04:00
|
|
|
extern status_t _kern_system_profiler_start(
|
|
|
|
struct system_profiler_parameters* parameters);
|
2009-04-23 17:47:52 +04:00
|
|
|
extern status_t _kern_system_profiler_next_buffer(size_t bytesRead,
|
|
|
|
uint64* _droppedEvents);
|
2009-04-12 02:20:51 +04:00
|
|
|
extern status_t _kern_system_profiler_stop();
|
2009-07-17 20:21:06 +04:00
|
|
|
extern status_t _kern_system_profiler_recorded(
|
|
|
|
struct system_profiler_parameters* parameters);
|
2009-04-12 02:20:51 +04:00
|
|
|
|
2003-08-22 03:02:00 +04:00
|
|
|
/* atomic_* ops (needed for CPUs that don't support them directly) */
|
2004-08-29 00:29:35 +04:00
|
|
|
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
|
2014-02-15 14:36:17 +04:00
|
|
|
extern void _kern_atomic_set(int32 *value, int32 newValue);
|
|
|
|
extern int32 _kern_atomic_get_and_set(int32 *value, int32 newValue);
|
|
|
|
extern int32 _kern_atomic_test_and_set(int32 *value, int32 newValue,
|
2009-06-19 12:23:11 +04:00
|
|
|
int32 testAgainst);
|
2014-02-15 14:36:17 +04:00
|
|
|
extern int32 _kern_atomic_add(int32 *value, int32 addValue);
|
|
|
|
extern int32 _kern_atomic_and(int32 *value, int32 andValue);
|
|
|
|
extern int32 _kern_atomic_or(int32 *value, int32 orValue);
|
|
|
|
extern int32 _kern_atomic_get(int32 *value);
|
2004-08-29 00:29:35 +04:00
|
|
|
#endif // ATOMIC_FUNCS_ARE_SYSCALLS
|
|
|
|
|
|
|
|
#ifdef ATOMIC64_FUNCS_ARE_SYSCALLS
|
2014-02-15 14:36:17 +04:00
|
|
|
extern void _kern_atomic_set64(int64 *value, int64 newValue);
|
|
|
|
extern int64 _kern_atomic_get_and_set64(int64 *value, int64 newValue);
|
|
|
|
extern int64 _kern_atomic_test_and_set64(int64 *value, int64 newValue,
|
2009-06-19 12:23:11 +04:00
|
|
|
int64 testAgainst);
|
2014-02-15 14:36:17 +04:00
|
|
|
extern int64 _kern_atomic_add64(int64 *value, int64 addValue);
|
|
|
|
extern int64 _kern_atomic_and64(int64 *value, int64 andValue);
|
|
|
|
extern int64 _kern_atomic_or64(int64 *value, int64 orValue);
|
|
|
|
extern int64 _kern_atomic_get64(int64 *value);
|
2004-08-29 00:29:35 +04:00
|
|
|
#endif // ATOMIC64_FUNCS_ARE_SYSCALLS
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-04-22 02:46:35 +04:00
|
|
|
/* System informations */
|
2013-12-16 06:58:43 +04:00
|
|
|
extern status_t _kern_get_system_info(system_info* info);
|
|
|
|
extern status_t _kern_get_cpu_info(uint32 firstCPU, uint32 cpuCount,
|
|
|
|
cpu_info* info);
|
|
|
|
extern status_t _kern_get_cpu_topology_info(
|
|
|
|
cpu_topology_node_info* topologyInfos,
|
|
|
|
uint32* topologyInfoCount);
|
|
|
|
|
2008-09-03 19:10:44 +04:00
|
|
|
extern status_t _kern_analyze_scheduling(bigtime_t from, bigtime_t until,
|
|
|
|
void* buffer, size_t size,
|
|
|
|
struct scheduling_analysis* analysis);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-05-30 00:23:00 +04:00
|
|
|
/* Debug output */
|
2004-12-14 19:06:34 +03:00
|
|
|
extern void _kern_debug_output(const char *message);
|
2008-01-21 18:10:05 +03:00
|
|
|
extern void _kern_ktrace_output(const char *message);
|
2005-05-30 00:23:00 +04:00
|
|
|
extern status_t _kern_frame_buffer_update(addr_t baseAddress, int32 width,
|
|
|
|
int32 height, int32 depth, int32 bytesPerRow);
|
2003-11-14 01:07:36 +03:00
|
|
|
|
2005-01-24 04:22:51 +03:00
|
|
|
/* messaging service */
|
|
|
|
extern area_id _kern_register_messaging_service(sem_id lockingSem,
|
|
|
|
sem_id counterSem);
|
|
|
|
extern status_t _kern_unregister_messaging_service();
|
|
|
|
|
2009-06-19 12:23:11 +04:00
|
|
|
extern void _kern_clear_caches(void *address, size_t length,
|
|
|
|
uint32 flags);
|
2006-02-01 19:09:05 +03:00
|
|
|
extern bool _kern_cpu_enabled(int32 cpu);
|
|
|
|
extern status_t _kern_set_cpu_enabled(int32 cpu, bool enabled);
|
2005-03-17 20:06:56 +03:00
|
|
|
|
2019-03-30 23:54:01 +03:00
|
|
|
#if defined(__i386__) || defined(__x86_64__)
|
2004-12-01 06:54:23 +03:00
|
|
|
// our only x86 only syscall
|
2004-12-14 19:06:34 +03:00
|
|
|
extern status_t _kern_get_cpuid(cpuid_info *info, uint32 eax, uint32 cpu);
|
2004-12-01 06:54:23 +03:00
|
|
|
#endif
|
|
|
|
|
2004-10-29 05:27:44 +04:00
|
|
|
|
2004-12-14 20:05:56 +03:00
|
|
|
/* Disk Device Manager syscalls */
|
2004-10-29 05:27:44 +04:00
|
|
|
|
|
|
|
// iterating, retrieving device/partition data
|
2008-10-14 01:51:43 +04:00
|
|
|
extern partition_id _kern_get_next_disk_device_id(int32 *cookie,
|
|
|
|
size_t *neededSize);
|
|
|
|
extern partition_id _kern_find_disk_device(const char *filename,
|
|
|
|
size_t *neededSize);
|
|
|
|
extern partition_id _kern_find_partition(const char *filename,
|
|
|
|
size_t *neededSize);
|
|
|
|
extern partition_id _kern_find_file_disk_device(const char *filename,
|
|
|
|
size_t *neededSize);
|
2007-11-02 02:36:21 +03:00
|
|
|
extern status_t _kern_get_disk_device_data(partition_id deviceID,
|
|
|
|
bool deviceOnly, struct user_disk_device_data *buffer,
|
2004-12-14 20:05:56 +03:00
|
|
|
size_t bufferSize, size_t *neededSize);
|
|
|
|
extern partition_id _kern_register_file_device(const char *filename);
|
|
|
|
extern status_t _kern_unregister_file_device(partition_id deviceID,
|
|
|
|
const char *filename);
|
2004-10-29 05:27:44 +04:00
|
|
|
// Only a valid deviceID or filename need to be passed. The other one
|
|
|
|
// is -1/NULL. If both is given only filename is ignored.
|
2008-10-14 01:51:43 +04:00
|
|
|
extern status_t _kern_get_file_disk_device_path(partition_id id,
|
|
|
|
char* buffer, size_t bufferSize);
|
2004-10-29 05:27:44 +04:00
|
|
|
|
|
|
|
// disk systems
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_get_disk_system_info(disk_system_id id,
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct user_disk_system_info *info);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_get_next_disk_system_info(int32 *cookie,
|
* Reintroduced third LinkAgainst parameter <mapLibs>, defaulting to true.
Library names are now mapped for all targets but "host" (not only for
"haiku") -- added one more level of indirection to achieve that.
(TARGET_LIBRARY_NAME_MAP -> *_LIBRARY_NAME_MAP_*).
* Renamed build/HaikuBuildCompatibility.h to BeOSBuildCompatibility.h
(auto-included when compiling something that uses the Be API for platform
"host" on anon-BeOS platform), and introduced build/HaikuBuildCompatibility.h,
which can be included when compiling something that can be built for both,
Haiku and BeOS compatible platforms.
* Introduced libhaikucompat.a, a library that adds a few functions existing
under Haiku, but not under BeOS.
* New rule AddSubDirSupportedPlatforms.
* Renamed libopenbeos.so to libbe_haiku.so.
* Introduced new target platform "libbe_test", which is basically equivalent
to a BeOS compatible host platform target, with the exception, that instead
of the host platform's libbe.so a special build of Haiku's libbe.so
(libbe_haiku.so (formerly known as libopenbeos.so)) is used. Furthermore
Haiku's public app, interface, storage, and support kit headers are used
when compiling. This replaces the less nice way in which the test app server
and applications for this test environment were built.
When building for platform "libbe_test", the library name "be" is
autotranslated to "libbe_haiku.so". Thus most applications don't need
special fiddling when them building them for the app server test environment;
usually an "AddSubDirSupportedPlatforms libbe_test ;" will suffice.
* Reduced the dependencies of <syscalls.h> and fixed problems caused by this
(e.g. source files not including the needed headers directly).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14749 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-07 19:07:25 +03:00
|
|
|
struct user_disk_system_info *info);
|
|
|
|
extern status_t _kern_find_disk_system(const char *name,
|
|
|
|
struct user_disk_system_info *info);
|
2004-10-29 05:27:44 +04:00
|
|
|
|
|
|
|
// disk device modification
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_defragment_partition(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter);
|
|
|
|
extern status_t _kern_repair_partition(partition_id partitionID,
|
|
|
|
int32* changeCounter, bool checkOnly);
|
|
|
|
extern status_t _kern_resize_partition(partition_id partitionID,
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
int32* childChangeCounter, off_t size,
|
|
|
|
off_t contentSize);
|
|
|
|
extern status_t _kern_move_partition(partition_id partitionID,
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
int32* childChangeCounter, off_t newOffset,
|
|
|
|
partition_id* descendantIDs,
|
|
|
|
int32* descendantChangeCounters, int32 descendantCount);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_set_partition_name(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
int32* childChangeCounter, const char* name);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_set_partition_content_name(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, const char* name);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_set_partition_type(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
int32* childChangeCounter, const char* type);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_set_partition_parameters(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, partition_id childID,
|
2009-07-26 21:27:27 +04:00
|
|
|
int32* childChangeCounter, const char* parameters);
|
2007-11-01 00:16:22 +03:00
|
|
|
extern status_t _kern_set_partition_content_parameters(
|
|
|
|
partition_id partitionID, int32* changeCounter,
|
2009-07-26 21:27:27 +04:00
|
|
|
const char* parameters);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_initialize_partition(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, const char* diskSystemName,
|
2009-07-26 21:27:27 +04:00
|
|
|
const char* name, const char* parameters);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_uninitialize_partition(partition_id partitionID,
|
2016-12-23 08:19:01 +03:00
|
|
|
int32* changeCounter, partition_id parentID,
|
|
|
|
int32* parentChangeCounter);
|
2004-12-14 20:05:56 +03:00
|
|
|
extern status_t _kern_create_child_partition(partition_id partitionID,
|
2007-11-01 00:16:22 +03:00
|
|
|
int32* changeCounter, off_t offset, off_t size,
|
|
|
|
const char* type, const char* name,
|
2009-07-26 21:27:27 +04:00
|
|
|
const char* parameters, partition_id* childID,
|
|
|
|
int32* childChangeCounter);
|
2007-11-01 00:16:22 +03:00
|
|
|
extern status_t _kern_delete_child_partition(partition_id partitionID,
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
int32 childChangeCounter);
|
2004-10-29 05:27:44 +04:00
|
|
|
|
2009-03-18 11:55:49 +03:00
|
|
|
// disk change notification
|
|
|
|
extern status_t _kern_start_watching_disks(uint32 eventMask, port_id port,
|
|
|
|
int32 token);
|
|
|
|
extern status_t _kern_stop_watching_disks(port_id port, int32 token);
|
2004-10-29 05:27:44 +04:00
|
|
|
|
|
|
|
|
2004-08-29 00:29:35 +04:00
|
|
|
// The end mark for gensyscallinfos.
|
|
|
|
#ifdef GEN_SYSCALL_INFOS_PROCESSING
|
|
|
|
#pragma syscalls end
|
|
|
|
#endif
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2009-11-26 19:59:46 +03:00
|
|
|
#undef __NO_RETURN
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-05-14 07:55:16 +04:00
|
|
|
#endif /* _SYSTEM_SYSCALLS_H */
|