10d93ca7cSJes Sorensen /* 20d93ca7cSJes Sorensen * posix specific declarations 30d93ca7cSJes Sorensen * 40d93ca7cSJes Sorensen * Copyright (c) 2003-2008 Fabrice Bellard 50d93ca7cSJes Sorensen * Copyright (c) 2010 Jes Sorensen <Jes.Sorensen@redhat.com> 60d93ca7cSJes Sorensen * 70d93ca7cSJes Sorensen * Permission is hereby granted, free of charge, to any person obtaining a copy 80d93ca7cSJes Sorensen * of this software and associated documentation files (the "Software"), to deal 90d93ca7cSJes Sorensen * in the Software without restriction, including without limitation the rights 100d93ca7cSJes Sorensen * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 110d93ca7cSJes Sorensen * copies of the Software, and to permit persons to whom the Software is 120d93ca7cSJes Sorensen * furnished to do so, subject to the following conditions: 130d93ca7cSJes Sorensen * 140d93ca7cSJes Sorensen * The above copyright notice and this permission notice shall be included in 150d93ca7cSJes Sorensen * all copies or substantial portions of the Software. 160d93ca7cSJes Sorensen * 170d93ca7cSJes Sorensen * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 180d93ca7cSJes Sorensen * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 190d93ca7cSJes Sorensen * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 200d93ca7cSJes Sorensen * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 210d93ca7cSJes Sorensen * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 220d93ca7cSJes Sorensen * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 230d93ca7cSJes Sorensen * THE SOFTWARE. 240d93ca7cSJes Sorensen */ 250d93ca7cSJes Sorensen 260d93ca7cSJes Sorensen #ifndef QEMU_OS_POSIX_H 270d93ca7cSJes Sorensen #define QEMU_OS_POSIX_H 280d93ca7cSJes Sorensen 29*02d0e095SPaolo Bonzini #include <sys/mman.h> 30a2d96af4SDaniel P. Berrange #include <sys/socket.h> 31a2d96af4SDaniel P. Berrange #include <netinet/in.h> 32a2d96af4SDaniel P. Berrange #include <netinet/tcp.h> 33a2d96af4SDaniel P. Berrange #include <arpa/inet.h> 34a2d96af4SDaniel P. Berrange #include <netdb.h> 35a2d96af4SDaniel P. Berrange #include <sys/un.h> 36506f40ffSWenchao Xia 379156d763SJes Sorensen void os_set_line_buffering(void); 38ce798cf2SJes Sorensen void os_set_proc_name(const char *s); 398d963e6aSJes Sorensen void os_setup_signal_handling(void); 40eb505be1SJes Sorensen void os_daemonize(void); 41eb505be1SJes Sorensen void os_setup_post(void); 42888a6bc6SSatoru Moriya int os_mlock(void); 438d963e6aSJes Sorensen 44a2d96af4SDaniel P. Berrange #define closesocket(s) close(s) 45a2d96af4SDaniel P. Berrange #define ioctlsocket(s, r, v) ioctl(s, r, v) 46a2d96af4SDaniel P. Berrange 47dc786bc9SJes Sorensen typedef struct timeval qemu_timeval; 48dc786bc9SJes Sorensen #define qemu_gettimeofday(tp) gettimeofday(tp, NULL) 49dc786bc9SJes Sorensen 5038671423SHidetoshi Seto #ifndef CONFIG_UTIMENSAT 5138671423SHidetoshi Seto #ifndef UTIME_NOW 5238671423SHidetoshi Seto # define UTIME_NOW ((1l << 30) - 1l) 5338671423SHidetoshi Seto #endif 5438671423SHidetoshi Seto #ifndef UTIME_OMIT 5538671423SHidetoshi Seto # define UTIME_OMIT ((1l << 30) - 2l) 5638671423SHidetoshi Seto #endif 5738671423SHidetoshi Seto #endif 5838671423SHidetoshi Seto typedef struct timespec qemu_timespec; 59ae0f940eSPaolo Bonzini int qemu_utimens(const char *path, const qemu_timespec *times); 6038671423SHidetoshi Seto 61995ee2bfSHitoshi Mitake bool is_daemonized(void); 62995ee2bfSHitoshi Mitake 630d93ca7cSJes Sorensen #endif 64