aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-03 13:22:58 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-11-07 09:53:18 +0100
commit4f0b9f91e40ac004f955e73860ee1a0eee9cab95 (patch)
treef32e85aee9fb11100a1e2800319b76252d0cd079 /util.h
parent17d40d1cb50e53b25eee522a165bba5f04a93a31 (diff)
downloadpasst-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar.gz
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar.bz2
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar.lz
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar.xz
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.tar.zst
passt-4f0b9f91e40ac004f955e73860ee1a0eee9cab95.zip
util: Add open_in_ns() helper
Most of our helpers which need to enter the pasta network namespace are quite specialised. Add one which is rather general - it just open()s a given file in the namespace context and returns the fd back to the main namespace. This will have some future uses. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r--util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/util.h b/util.h
index 9effc54..78a8fb2 100644
--- a/util.h
+++ b/util.h
@@ -219,6 +219,7 @@ int bitmap_isset(const uint8_t *map, int bit);
char *line_read(char *buf, size_t len, int fd);
void ns_enter(const struct ctx *c);
bool ns_is_init(void);
+int open_in_ns(const struct ctx *c, const char *path, int flags);
void write_pidfile(int fd, pid_t pid);
int __daemon(int pidfile_fd, int devnull_fd);
int fls(unsigned long x);