]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/lib/tsan/rtl/tsan_fd.h
1 //===-- tsan_fd.h -----------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of ThreadSanitizer (TSan), a race detector.
12 // This file handles synchronization via IO.
13 // People use IO for synchronization along the lines of:
16 // int client_socket; // initialized elsewhere
17 // int server_socket; // initialized elsewhere
21 // send(client_socket, ...);
24 // if (recv(server_socket, ...) > 0)
27 // This file determines the scope of the file descriptor (pipe, socket,
28 // all local files, etc) and executes acquire and release operations on
29 // the scope as necessary. Some scopes are very fine grained (e.g. pipe
30 // operations synchronize only with operations on the same pipe), while
31 // others are corse-grained (e.g. all operations on local files synchronize
33 //===----------------------------------------------------------------------===//
42 void FdAcquire(ThreadState
*thr
, uptr pc
, int fd
);
43 void FdRelease(ThreadState
*thr
, uptr pc
, int fd
);
44 void FdAccess(ThreadState
*thr
, uptr pc
, int fd
);
45 void FdClose(ThreadState
*thr
, uptr pc
, int fd
, bool write
= true);
46 void FdFileCreate(ThreadState
*thr
, uptr pc
, int fd
);
47 void FdDup(ThreadState
*thr
, uptr pc
, int oldfd
, int newfd
, bool write
);
48 void FdPipeCreate(ThreadState
*thr
, uptr pc
, int rfd
, int wfd
);
49 void FdEventCreate(ThreadState
*thr
, uptr pc
, int fd
);
50 void FdSignalCreate(ThreadState
*thr
, uptr pc
, int fd
);
51 void FdInotifyCreate(ThreadState
*thr
, uptr pc
, int fd
);
52 void FdPollCreate(ThreadState
*thr
, uptr pc
, int fd
);
53 void FdSocketCreate(ThreadState
*thr
, uptr pc
, int fd
);
54 void FdSocketAccept(ThreadState
*thr
, uptr pc
, int fd
, int newfd
);
55 void FdSocketConnecting(ThreadState
*thr
, uptr pc
, int fd
);
56 void FdSocketConnect(ThreadState
*thr
, uptr pc
, int fd
);
57 bool FdLocation(uptr addr
, int *fd
, int *tid
, u32
*stack
);
58 void FdOnFork(ThreadState
*thr
, uptr pc
);
60 uptr
File2addr(const char *path
);
61 uptr
Dir2addr(const char *path
);
65 #endif // TSAN_INTERFACE_H