annotate libsanitizer/tsan/tsan_fd.h @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 //===-- tsan_fd.h -----------------------------------------------*- C++ -*-===//
kono
parents:
diff changeset
2 //
kono
parents:
diff changeset
3 // This file is distributed under the University of Illinois Open Source
kono
parents:
diff changeset
4 // License. See LICENSE.TXT for details.
kono
parents:
diff changeset
5 //
kono
parents:
diff changeset
6 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
7 //
kono
parents:
diff changeset
8 // This file is a part of ThreadSanitizer (TSan), a race detector.
kono
parents:
diff changeset
9 //
kono
parents:
diff changeset
10 // This file handles synchronization via IO.
kono
parents:
diff changeset
11 // People use IO for synchronization along the lines of:
kono
parents:
diff changeset
12 //
kono
parents:
diff changeset
13 // int X;
kono
parents:
diff changeset
14 // int client_socket; // initialized elsewhere
kono
parents:
diff changeset
15 // int server_socket; // initialized elsewhere
kono
parents:
diff changeset
16 //
kono
parents:
diff changeset
17 // Thread 1:
kono
parents:
diff changeset
18 // X = 42;
kono
parents:
diff changeset
19 // send(client_socket, ...);
kono
parents:
diff changeset
20 //
kono
parents:
diff changeset
21 // Thread 2:
kono
parents:
diff changeset
22 // if (recv(server_socket, ...) > 0)
kono
parents:
diff changeset
23 // assert(X == 42);
kono
parents:
diff changeset
24 //
kono
parents:
diff changeset
25 // This file determines the scope of the file descriptor (pipe, socket,
kono
parents:
diff changeset
26 // all local files, etc) and executes acquire and release operations on
kono
parents:
diff changeset
27 // the scope as necessary. Some scopes are very fine grained (e.g. pipe
kono
parents:
diff changeset
28 // operations synchronize only with operations on the same pipe), while
kono
parents:
diff changeset
29 // others are corse-grained (e.g. all operations on local files synchronize
kono
parents:
diff changeset
30 // with each other).
kono
parents:
diff changeset
31 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
32 #ifndef TSAN_FD_H
kono
parents:
diff changeset
33 #define TSAN_FD_H
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 #include "tsan_rtl.h"
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 namespace __tsan {
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 void FdInit();
kono
parents:
diff changeset
40 void FdAcquire(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
41 void FdRelease(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
42 void FdAccess(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
43 void FdClose(ThreadState *thr, uptr pc, int fd, bool write = true);
kono
parents:
diff changeset
44 void FdFileCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
45 void FdDup(ThreadState *thr, uptr pc, int oldfd, int newfd, bool write);
kono
parents:
diff changeset
46 void FdPipeCreate(ThreadState *thr, uptr pc, int rfd, int wfd);
kono
parents:
diff changeset
47 void FdEventCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
48 void FdSignalCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
49 void FdInotifyCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
50 void FdPollCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
51 void FdSocketCreate(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
52 void FdSocketAccept(ThreadState *thr, uptr pc, int fd, int newfd);
kono
parents:
diff changeset
53 void FdSocketConnecting(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
54 void FdSocketConnect(ThreadState *thr, uptr pc, int fd);
kono
parents:
diff changeset
55 bool FdLocation(uptr addr, int *fd, int *tid, u32 *stack);
kono
parents:
diff changeset
56 void FdOnFork(ThreadState *thr, uptr pc);
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 uptr File2addr(const char *path);
kono
parents:
diff changeset
59 uptr Dir2addr(const char *path);
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 } // namespace __tsan
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 #endif // TSAN_INTERFACE_H