Several follow-up changes required by the changes either to the VFS

syscalls or to the syscall mechanism (which exposed naming and parameter
inconsistencies).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8703 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2004-08-28 20:45:00 +00:00
parent 3d6fb35361
commit 383cdedbd2
22 changed files with 71 additions and 67 deletions
+3 -3
View File
@@ -12,8 +12,8 @@
extern int handle_signals(struct thread *t, int state);
extern int user_send_signal(pid_t tid, uint sig);
extern int user_sigaction(int sig, const struct sigaction *act, struct sigaction *oact);
extern bigtime_t user_set_alarm(bigtime_t time, uint32 mode);
extern int _user_send_signal(pid_t tid, uint sig);
extern int _user_sigaction(int sig, const struct sigaction *act, struct sigaction *oact);
extern bigtime_t _user_set_alarm(bigtime_t time, uint32 mode);
#endif /* _KERNEL_SIGNAL_H */
+12 -12
View File
@@ -19,28 +19,28 @@ int32 port_used_ports(void);
void port_test(void);
// user-level API
port_id user_create_port(int32 queue_length, const char *name);
status_t user_close_port(port_id id);
status_t user_delete_port(port_id id);
port_id user_find_port(const char *port_name);
status_t user_get_port_info(port_id id, struct port_info *info);
status_t user_get_next_port_info(team_id team,
port_id _user_create_port(int32 queue_length, const char *name);
status_t _user_close_port(port_id id);
status_t _user_delete_port(port_id id);
port_id _user_find_port(const char *port_name);
status_t _user_get_port_info(port_id id, struct port_info *info);
status_t _user_get_next_port_info(team_id team,
int32 *cookie,
struct port_info *info);
ssize_t user_port_buffer_size_etc(port_id port,
ssize_t _user_port_buffer_size_etc(port_id port,
uint32 flags,
bigtime_t timeout);
ssize_t user_port_count(port_id port);
status_t user_read_port_etc(port_id port,
ssize_t _user_port_count(port_id port);
status_t _user_read_port_etc(port_id port,
int32 *msg_code,
void *msg_buffer,
size_t buffer_size,
uint32 flags,
bigtime_t timeout);
status_t user_set_port_owner(port_id port, team_id team);
status_t user_write_port_etc(port_id port,
status_t _user_set_port_owner(port_id port, team_id team);
status_t _user_write_port_etc(port_id port,
int32 msg_code,
void *msg_buffer,
const void *msg_buffer,
size_t buffer_size,
uint32 flags,
bigtime_t timeout);
+11 -11
View File
@@ -13,17 +13,17 @@ struct kernel_args;
/* user calls */
sem_id user_create_sem(int32 count, const char *name);
status_t user_delete_sem(sem_id id);
status_t user_delete_sem_etc(sem_id id, status_t return_code, bool interrupted);
status_t user_acquire_sem(sem_id id);
status_t user_acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
status_t user_release_sem(sem_id id);
status_t user_release_sem_etc(sem_id id, int32 count, uint32 flags);
status_t user_get_sem_count(sem_id id, int32* thread_count);
status_t user_get_sem_info(sem_id, struct sem_info *, size_t);
status_t user_get_next_sem_info(team_id, int32 *, struct sem_info *, size_t);
status_t user_set_sem_owner(sem_id id, team_id team);
sem_id _user_create_sem(int32 count, const char *name);
status_t _user_delete_sem(sem_id id);
status_t _user_delete_sem_etc(sem_id id, status_t return_code, bool interrupted);
status_t _user_acquire_sem(sem_id id);
status_t _user_acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
status_t _user_release_sem(sem_id id);
status_t _user_release_sem_etc(sem_id id, int32 count, uint32 flags);
status_t _user_get_sem_count(sem_id id, int32* thread_count);
status_t _user_get_sem_info(sem_id, struct sem_info *, size_t);
status_t _user_get_next_sem_info(team_id, int32 *, struct sem_info *, size_t);
status_t _user_set_sem_owner(sem_id id, team_id team);
/* kernel calls */
extern sem_id create_sem_etc(int32 count, const char *name, team_id owner);
+1 -1
View File
@@ -108,7 +108,7 @@ extern "C" {
#endif
#ifdef _KERNEL_MODE
int user_sysctl(int *, uint, void *, size_t *, void *, size_t);
int _user_sysctl(int *, uint, void *, size_t *, void *, size_t);
#endif
int sysctl(int *, uint, void *, size_t *, void *, size_t);
+2 -2
View File
@@ -38,8 +38,8 @@ status_t _user_get_team_info(team_id id, team_info *info);
status_t _user_get_next_team_info(int32 *cookie, team_info *info);
// ToDo: please move the "env" setter/getter out of the kernel!
int user_setenv(const char *name, const char *value, int overwrite);
int user_getenv(const char *name, char **value);
int _user_setenv(const char *name, const char *value, int overwrite);
int _user_getenv(const char *name, char **value);
#ifdef __cplusplus
}
+1 -1
View File
@@ -67,7 +67,7 @@ int user_memset(void *s, char c, size_t count);
area_id _user_create_area(const char *name, void **address, uint32 addressSpec,
size_t size, uint32 lock, uint32 protection);
status_t _user_delete_area(area_id area);
region_id user_vm_map_file(char *uname, void **uaddress, int addr_type,
region_id _user_vm_map_file(const char *uname, void **uaddress, int addr_type,
addr size, int lock, int mapping, const char *upath, off_t offset);
area_id _user_area_for(void *address);
area_id _user_find_area(const char *name);
+1 -1
View File
@@ -1083,7 +1083,7 @@ vm_map_file(aspace_id aid, char *name, void **address, int addr_type,
region_id
user_vm_map_file(char *uname, void **uaddress, int addr_type,
_user_vm_map_file(const char *uname, void **uaddress, int addr_type,
addr_t size, int lock, int mapping, const char *upath, off_t offset)
{
char name[B_OS_NAME_LENGTH];
+1 -1
View File
@@ -80,7 +80,7 @@ fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo)
if (attr < 0)
RETURN_AND_SET_ERRNO(attr);
status = _kern_read_stat(attr, &stat, sizeof(struct stat));
status = _kern_read_stat(attr, NULL, false, &stat, sizeof(struct stat));
if (status == B_OK) {
attrInfo->type = stat.st_type;
attrInfo->size = stat.st_size;
+1 -1
View File
@@ -27,7 +27,7 @@ dev_t
dev_for_path(const char *path)
{
struct stat stat;
int status = _kern_read_path_stat(path, false, &stat, sizeof(struct stat));
int status = _kern_read_stat(-1, path, false, &stat, sizeof(struct stat));
if (status == B_OK)
return stat.st_dev;
+14 -14
View File
@@ -11,28 +11,28 @@
port_id
create_port(int32 capacity, const char *name)
{
return sys_port_create(capacity, name);
return _kern_create_port(capacity, name);
}
port_id
find_port(const char *name)
{
return sys_port_find(name);
return _kern_find_port(name);
}
status_t
write_port(port_id port, int32 code, const void *buffer, size_t bufferSize)
{
return sys_port_write(port, code, buffer, bufferSize);
return _kern_write_port_etc(port, code, buffer, bufferSize, 0, 0);
}
status_t
read_port(port_id port, int32 *code, void *buffer, size_t bufferSize)
{
return sys_port_read(port, code, buffer, bufferSize);
return _kern_read_port_etc(port, code, buffer, bufferSize, 0, 0);
}
@@ -40,7 +40,7 @@ status_t
write_port_etc(port_id port, int32 code, const void *buffer, size_t bufferSize,
uint32 flags, bigtime_t timeout)
{
return sys_port_write_etc(port, code, buffer, bufferSize, flags, timeout);
return _kern_write_port_etc(port, code, buffer, bufferSize, flags, timeout);
}
@@ -48,49 +48,49 @@ status_t
read_port_etc(port_id port, int32 *code, void *buffer, size_t bufferSize,
uint32 flags, bigtime_t timeout)
{
return sys_port_read_etc(port, code, buffer, bufferSize, flags, timeout);
return _kern_read_port_etc(port, code, buffer, bufferSize, flags, timeout);
}
ssize_t
port_buffer_size(port_id port)
{
return sys_port_buffer_size(port);
return _kern_port_buffer_size_etc(port, 0, 0);
}
ssize_t
port_buffer_size_etc(port_id port, uint32 flags, bigtime_t timeout)
{
return sys_port_buffer_size_etc(port, flags, timeout);
return _kern_port_buffer_size_etc(port, flags, timeout);
}
ssize_t
port_count(port_id port)
{
return sys_port_count(port);
return _kern_port_count(port);
}
status_t
set_port_owner(port_id port, team_id team)
{
return sys_port_set_owner(port, team);
return _kern_set_port_owner(port, team);
}
status_t
close_port(port_id port)
{
return sys_port_close(port);
return _kern_close_port(port);
}
status_t
delete_port(port_id port)
{
return sys_port_delete(port);
return _kern_delete_port(port);
}
@@ -100,13 +100,13 @@ _get_next_port_info(team_id team, int32 *cookie, port_info *info, size_t size)
// size is not yet used, but may, if port_info changes
(void)size;
return sys_port_get_next_port_info(team, cookie, info);
return _kern_get_next_port_info(team, cookie, info);
}
status_t
_get_port_info(port_id port, port_info *info, size_t size)
{
return sys_port_get_info(port, info);
return _kern_get_port_info(port, info);
}
+1 -1
View File
@@ -53,7 +53,7 @@ release_sem_etc(sem_id id, int32 count, uint32 flags)
status_t
get_sem_count(sem_id sem, int32 *count)
{
return sys_sem_get_count(sem, count);
return sys_get_sem_count(sem, count);
}
+1 -1
View File
@@ -12,7 +12,7 @@
int
remove(const char *path)
{
int status = _kern_unlink(path);
int status = _kern_unlink(-1, path);
if (status < B_OK) {
errno = status;
return -1;
+1 -1
View File
@@ -12,7 +12,7 @@
int
rename(const char *from, const char *to)
{
int status = _kern_rename(from, to);
int status = _kern_rename(-1, from, -1, to);
if (status < B_OK) {
errno = status;
return -1;
+4 -2
View File
@@ -26,7 +26,8 @@ chmod(const char *path, mode_t mode)
status_t status;
stat.st_mode = mode;
status = _kern_write_path_stat(path, true, &stat, sizeof(struct stat), FS_WRITE_STAT_MODE);
status = _kern_write_stat(-1, path, true, &stat, sizeof(struct stat),
FS_WRITE_STAT_MODE);
RETURN_AND_SET_ERRNO(status);
}
@@ -39,7 +40,8 @@ fchmod(int fd, mode_t mode)
status_t status;
stat.st_mode = mode;
status = _kern_write_stat(fd, &stat, sizeof(struct stat), FS_WRITE_STAT_MODE);
status = _kern_write_stat(fd, NULL, false, &stat, sizeof(struct stat),
FS_WRITE_STAT_MODE);
RETURN_AND_SET_ERRNO(status);
}
+1 -1
View File
@@ -20,7 +20,7 @@
int
mkdir(const char *path, mode_t mode)
{
status_t status = _kern_create_dir(path, mode);
status_t status = _kern_create_dir(-1, path, mode);
RETURN_AND_SET_ERRNO(status);
}
+3 -3
View File
@@ -56,7 +56,7 @@ lstat(const char *path, struct stat *stat)
int
_stat(const char *path, struct stat *stat, size_t statSize)
{
int status = _kern_read_path_stat(path, true, stat, statSize);
int status = _kern_read_stat(-1, path, true, stat, statSize);
RETURN_AND_SET_ERRNO(status);
}
@@ -65,7 +65,7 @@ _stat(const char *path, struct stat *stat, size_t statSize)
int
_lstat(const char *path, struct stat *stat, size_t statSize)
{
int status = _kern_read_path_stat(path, false, stat, statSize);
int status = _kern_read_stat(-1, path, false, stat, statSize);
RETURN_AND_SET_ERRNO(status);
}
@@ -74,7 +74,7 @@ _lstat(const char *path, struct stat *stat, size_t statSize)
int
_fstat(int fd, struct stat *stat, size_t statSize)
{
int status = _kern_read_stat(fd, stat, statSize);
int status = _kern_read_stat(fd, NULL, false, stat, statSize);
RETURN_AND_SET_ERRNO(status);
}
+3 -3
View File
@@ -27,7 +27,7 @@ chown(const char *path, uid_t owner, gid_t group)
stat.st_uid = owner;
stat.st_gid = group;
status = _kern_write_path_stat(path, true, &stat, sizeof(struct stat),
status = _kern_write_stat(-1, path, true, &stat, sizeof(struct stat),
FS_WRITE_STAT_UID | FS_WRITE_STAT_GID);
RETURN_AND_SET_ERRNO(status);
@@ -42,7 +42,7 @@ lchown(const char *path, uid_t owner, gid_t group)
stat.st_uid = owner;
stat.st_gid = group;
status = _kern_write_path_stat(path, false, &stat, sizeof(struct stat),
status = _kern_write_stat(-1, path, false, &stat, sizeof(struct stat),
FS_WRITE_STAT_UID | FS_WRITE_STAT_GID);
RETURN_AND_SET_ERRNO(status);
@@ -57,7 +57,7 @@ fchown(int fd, uid_t owner, gid_t group)
stat.st_uid = owner;
stat.st_gid = group;
status = _kern_write_stat(fd, &stat, sizeof(struct stat),
status = _kern_write_stat(fd, NULL, false, &stat, sizeof(struct stat),
FS_WRITE_STAT_UID | FS_WRITE_STAT_GID);
RETURN_AND_SET_ERRNO(status);
+1 -1
View File
@@ -29,7 +29,7 @@ opendir(const char *path)
{
DIR *dir;
int fd = _kern_open_dir(path);
int fd = _kern_open_dir(-1, path);
if (fd < 0) {
errno = fd;
return NULL;
+3 -3
View File
@@ -20,7 +20,7 @@
ssize_t
readlink(const char *path, char *buffer, size_t bufferSize)
{
int status = _kern_read_link(path, buffer, bufferSize);
int status = _kern_read_link(-1, path, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@@ -29,7 +29,7 @@ readlink(const char *path, char *buffer, size_t bufferSize)
int
symlink(const char *path, const char *toPath)
{
int status = _kern_create_symlink(path, toPath, 0);
int status = _kern_create_symlink(-1, path, toPath, 0);
RETURN_AND_SET_ERRNO(status);
}
@@ -38,7 +38,7 @@ symlink(const char *path, const char *toPath)
int
unlink(const char *path)
{
int status = _kern_unlink(path);
int status = _kern_unlink(-1, path);
RETURN_AND_SET_ERRNO(status);
}
+1 -1
View File
@@ -41,7 +41,7 @@ open(const char *path, int oflags, ...)
if (oflags & O_CREAT)
status = _kern_create(path, oflags, perms);
else
status = _kern_open(path, oflags);
status = _kern_open(-1, path, oflags);
if (status < 0) {
errno = status;
+4 -2
View File
@@ -26,7 +26,8 @@ truncate(const char *path, off_t newSize)
status_t status;
stat.st_size = newSize;
status = _kern_write_path_stat(path, true, &stat, sizeof(struct stat), FS_WRITE_STAT_SIZE);
status = _kern_write_stat(-1, path, true, &stat, sizeof(struct stat),
FS_WRITE_STAT_SIZE);
RETURN_AND_SET_ERRNO(status);
}
@@ -39,7 +40,8 @@ ftruncate(int fd, off_t newSize)
status_t status;
stat.st_size = newSize;
status = _kern_write_stat(fd, &stat, sizeof(struct stat), FS_WRITE_STAT_SIZE);
status = _kern_write_stat(fd, NULL, false, &stat, sizeof(struct stat),
FS_WRITE_STAT_SIZE);
RETURN_AND_SET_ERRNO(status);
}
+1 -1
View File
@@ -32,7 +32,7 @@ utime(const char *path, const struct utimbuf *times)
} else
stat.st_atime = stat.st_mtime = time(NULL);
status = _kern_write_path_stat(path, true, &stat, sizeof(struct stat),
status = _kern_write_stat(-1, path, true, &stat, sizeof(struct stat),
FS_WRITE_STAT_MTIME | FS_WRITE_STAT_ATIME);
RETURN_AND_SET_ERRNO(status);