source: azure_iot_hub/trunk/musl-1.1.18/src/ipc/ftok.c@ 388

Last change on this file since 388 was 388, checked in by coas-nagasima, 5 years ago

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
File size: 224 bytes
Line 
1#include <sys/ipc.h>
2#include <sys/stat.h>
3
4key_t ftok(const char *path, int id)
5{
6 struct stat st;
7 if (stat(path, &st) < 0) return -1;
8
9 return ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) | ((id & 0xffu) << 24));
10}
Note: See TracBrowser for help on using the repository browser.