summaryrefslogtreecommitdiffstats
path: root/usr/klibc/shm_unlink.c
blob: 94a98a05305a50ed9a41a6ab409469778654a6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * shm_unlink.c
 *
 * POSIX shared memory support
 */

#include <stdlib.h>
#include <alloca.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>


int shm_unlink(const char *path)
{
	int len = strlen(path);
	char *pathbuf = alloca(len+10);

	memcpy(pathbuf, "/dev/shm/", 9);
	memcpy(pathbuf+9, path, len+1);

	return unlink(path);
}