2012-12-11 20:27:27 +08:00
|
|
|
//===-- msan_platform_limits.cc -------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of MemorySanitizer.
|
|
|
|
//
|
|
|
|
// Sizes and layouts of platform-specific POSIX data structures.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifdef __linux__
|
|
|
|
|
|
|
|
#include "msan.h"
|
|
|
|
#include "msan_platform_limits_posix.h"
|
|
|
|
|
|
|
|
#include <sys/utsname.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2013-01-17 21:42:17 +08:00
|
|
|
#include <sys/time.h>
|
2012-12-11 20:27:27 +08:00
|
|
|
#include <sys/resource.h>
|
|
|
|
#include <sys/vfs.h>
|
|
|
|
#include <sys/epoll.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
|
|
|
|
namespace __msan {
|
|
|
|
unsigned struct_utsname_sz = sizeof(struct utsname);
|
|
|
|
unsigned struct_stat_sz = sizeof(struct stat);
|
|
|
|
unsigned struct_stat64_sz = sizeof(struct stat64);
|
|
|
|
unsigned struct_rlimit_sz = sizeof(struct rlimit);
|
|
|
|
unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
|
|
|
|
unsigned struct_dirent_sz = sizeof(struct dirent);
|
|
|
|
unsigned struct_statfs_sz = sizeof(struct statfs);
|
|
|
|
unsigned struct_statfs64_sz = sizeof(struct statfs64);
|
|
|
|
unsigned struct_epoll_event_sz = sizeof(struct epoll_event);
|
2013-01-17 21:42:17 +08:00
|
|
|
unsigned struct_rusage_sz = sizeof(struct rusage);
|
2012-12-11 20:27:27 +08:00
|
|
|
|
|
|
|
void* __msan_get_msghdr_iov_iov_base(void* msg, int idx) {
|
|
|
|
return ((struct msghdr *)msg)->msg_iov[idx].iov_base;
|
|
|
|
}
|
|
|
|
|
|
|
|
uptr __msan_get_msghdr_iov_iov_len(void* msg, int idx) {
|
|
|
|
return ((struct msghdr *)msg)->msg_iov[idx].iov_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
uptr __msan_get_msghdr_iovlen(void* msg) {
|
|
|
|
return ((struct msghdr *)msg)->msg_iovlen;
|
|
|
|
}
|
2012-12-26 00:51:57 +08:00
|
|
|
|
|
|
|
uptr __msan_get_socklen_t(void* socklen_ptr) {
|
|
|
|
return *(socklen_t*)socklen_ptr;
|
|
|
|
}
|
2012-12-12 18:50:48 +08:00
|
|
|
}
|
2012-12-11 20:27:27 +08:00
|
|
|
|
|
|
|
#endif // __linux__
|