Merge branch 'tb/commit-graph-genv2-upgrade-fix' into maint
[git/debian.git] / unix-stream-server.h
blobae2712ba39b1f3502b6a9d49d92bc1e390cfa2b4
1 #ifndef UNIX_STREAM_SERVER_H
2 #define UNIX_STREAM_SERVER_H
4 #include "unix-socket.h"
6 struct unix_ss_socket {
7 char *path_socket;
8 struct stat st_socket;
9 int fd_socket;
13 * Create a Unix Domain Socket at the given path under the protection
14 * of a '.lock' lockfile.
16 * Returns 0 on success, -1 on error, -2 if socket is in use.
18 int unix_ss_create(const char *path,
19 const struct unix_stream_listen_opts *opts,
20 long timeout_ms,
21 struct unix_ss_socket **server_socket);
24 * Close and delete the socket.
26 void unix_ss_free(struct unix_ss_socket *server_socket);
29 * Return 1 if the inode of the pathname to our socket changes.
31 int unix_ss_was_stolen(struct unix_ss_socket *server_socket);
33 #endif /* UNIX_STREAM_SERVER_H */