OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [sys/] [linux/] [shm_unlink.c] - Blame information for rev 258

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* shm_unlink - remove a shared memory file */
2
 
3
/* Copyright 2002, Red Hat Inc. */
4
 
5
#include <sys/types.h>
6
#include <sys/mman.h>
7
#include <unistd.h>
8
#include <string.h>
9
#include <limits.h>
10
 
11
int
12
shm_unlink (const char *name)
13
{
14
  int rc;
15
  char shm_name[PATH_MAX+20] = "/dev/shm/";
16
 
17
  /* skip opening slash */
18
  if (*name == '/')
19
    ++name;
20
 
21
  /* create special shared memory file name and leave enough space to
22
     cause a path/name error if name is too long */
23
  strlcpy (shm_name + 9, name, PATH_MAX + 10);
24
 
25
  rc = unlink (shm_name);
26
 
27
  return rc;
28
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.