Lines Matching +full:semi +full:- +full:static
35 static int create_exclusive(const char *);
40 * - make a mostly unique filename and try to create it.
41 * - link the unique filename to our target
42 * - get the link count of the target
43 * - unlink the mostly unique filename
44 * - if the link count was 2, then we are ok; else we've failed.
46 static int
59 hostname[sizeof(hostname) - 1] = '\0'; in create_exclusive()
65 * We generate a semi-unique filename, from hostname.(pid ^ usec) in create_exclusive()
73 (int)(ptr - fname), fname, hostname, (u_long)cookie); in create_exclusive()
80 if (fd != -1) { in create_exclusive()
87 return -1; in create_exclusive()
93 if (link(path, fname) == -1) in create_exclusive()
100 if (stat(path, &st) == -1) in create_exclusive()
111 return -1; in create_exclusive()
119 return -1; in create_exclusive()
123 * fname -- Pathname to lock
124 * pollinterval -- Interval (miliseconds) to check for lock, -1 return
145 retval = -1; in dot_lock()
149 if (create_exclusive(path) != -1) { in dot_lock()
161 if (pollinterval == -1) { in dot_lock()