Kernel: Implement deletion of SMO objects
This commit is contained in:
@@ -38,7 +38,9 @@ int load_keymap(const char* path);
|
||||
|
||||
// Create shared memory object and return its key or -1 on error
|
||||
long smo_create(size_t size, int prot);
|
||||
// Map shared memory object defined by its key and return address or null on error
|
||||
// Delete shared memory object such that it will be no longer accessible with smo_map(). Existing mappings are still valid
|
||||
int smo_delete(long key);
|
||||
// Map shared memory object defined by its key and return address or null on error. Mappings can be unmapped using munmap()
|
||||
void* smo_map(long key);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -75,6 +75,7 @@ __BEGIN_DECLS
|
||||
O(SYS_PSELECT, pselect) \
|
||||
O(SYS_TRUNCATE, truncate) \
|
||||
O(SYS_SMO_CREATE, smo_create) \
|
||||
O(SYS_SMO_DELETE, smo_delete) \
|
||||
O(SYS_SMO_MAP, smo_map) \
|
||||
|
||||
enum Syscall
|
||||
|
||||
@@ -22,6 +22,11 @@ long smo_create(size_t size, int prot)
|
||||
return syscall(SYS_SMO_CREATE, size, prot);
|
||||
}
|
||||
|
||||
int smo_delete(long key)
|
||||
{
|
||||
return syscall(SYS_SMO_DELETE, key);
|
||||
}
|
||||
|
||||
void* smo_map(long key)
|
||||
{
|
||||
long ret = syscall(SYS_SMO_MAP, key);
|
||||
|
||||
Reference in New Issue
Block a user