Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7aaa8a21a8
Fetching contributors…

Cannot retrieve contributors at this time

68 lines (56 sloc) 1.678 kb
/*
* <sys/sendfile.h> wrapper functions.
*
* Authors:
* Jonathan Pryor (jonpryor@vt.edu)
*
* Copyright (C) 2004 Jonathan Pryor
*/
#include <sys/types.h>
#include <errno.h>
#include <stdlib.h>
#include "map.h"
#include "mph.h"
#include <sys/utsname.h>
G_BEGIN_DECLS
static const mph_string_offset_t
utsname_offsets[] = {
MPH_STRING_OFFSET(struct utsname, sysname, MPH_STRING_OFFSET_ARRAY),
MPH_STRING_OFFSET(struct utsname, nodename, MPH_STRING_OFFSET_ARRAY),
MPH_STRING_OFFSET(struct utsname, release, MPH_STRING_OFFSET_ARRAY),
MPH_STRING_OFFSET(struct utsname, version, MPH_STRING_OFFSET_ARRAY),
MPH_STRING_OFFSET(struct utsname, machine, MPH_STRING_OFFSET_ARRAY)
};
static const mph_string_offset_t
mph_utsname_offsets[] = {
MPH_STRING_OFFSET(struct Mono_Posix_Syscall__Utsname, sysname, MPH_STRING_OFFSET_PTR),
MPH_STRING_OFFSET(struct Mono_Posix_Syscall__Utsname, nodename, MPH_STRING_OFFSET_PTR),
MPH_STRING_OFFSET(struct Mono_Posix_Syscall__Utsname, release, MPH_STRING_OFFSET_PTR),
MPH_STRING_OFFSET(struct Mono_Posix_Syscall__Utsname, version, MPH_STRING_OFFSET_PTR),
MPH_STRING_OFFSET(struct Mono_Posix_Syscall__Utsname, machine, MPH_STRING_OFFSET_PTR)
};
int
Mono_Posix_Syscall_uname (struct Mono_Posix_Syscall__Utsname *buf)
{
struct utsname _buf;
int r;
if (!buf) {
errno = EFAULT;
return -1;
}
r = uname (&_buf);
if (r == 0) {
buf->_buf_ = _mph_copy_structure_strings (buf, mph_utsname_offsets,
&_buf, utsname_offsets, sizeof(utsname_offsets)/sizeof(utsname_offsets[0]));
buf->domainname = NULL;
if (!buf->_buf_) {
errno = ENOMEM;
return -1;
}
}
return r;
}
G_END_DECLS
/*
* vim: noexpandtab
*/
Jump to Line
Something went wrong with that request. Please try again.