Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / lib / libsys / socketpath.c
blobe4634bfb0d2d02061abca60e5b70651176554f8b
1 #include "syslib.h"
3 #include <unistd.h>
4 #include <string.h>
5 #include <minix/safecopies.h>
7 int
8 socketpath(endpoint_t endpt, const char * path, size_t size, int what,
9 dev_t * dev, ino_t * ino)
11 cp_grant_id_t grant;
12 message m;
13 int r;
15 if ((grant = cpf_grant_direct(VFS_PROC_NR, (vir_bytes)path, size,
16 CPF_READ)) == GRANT_INVALID)
17 return ENOMEM;
19 memset(&m, 0, sizeof(m));
20 m.m_lsys_vfs_socketpath.endpt = endpt;
21 m.m_lsys_vfs_socketpath.grant = grant;
22 m.m_lsys_vfs_socketpath.count = size;
23 m.m_lsys_vfs_socketpath.what = what;
25 r = _taskcall(VFS_PROC_NR, VFS_SOCKETPATH, &m);
27 cpf_revoke(grant);
29 if (r == OK) {
30 *dev = m.m_vfs_lsys_socketpath.device;
31 *ino = m.m_vfs_lsys_socketpath.inode;
34 return r;