Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/shm_open.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 387 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 387 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * shm_open.c |
3 | * |
4 | * POSIX shared memory support |
5 | */ |
6 | |
7 | #include <stdlib.h> |
8 | #include <alloca.h> |
9 | #include <string.h> |
10 | #include <unistd.h> |
11 | #include <sys/mman.h> |
12 | |
13 | |
14 | int shm_open(const char *path, int oflag, mode_t mode) |
15 | { |
16 | int len = strlen(path); |
17 | char *pathbuf = alloca(len+10); |
18 | |
19 | memcpy(pathbuf, "/dev/shm/", 9); |
20 | memcpy(pathbuf+9, path, len+1); |
21 | |
22 | return open_cloexec(path, oflag, mode); |
23 | } |