socket-util: add new helper socket_xattr_supported()

This commit is contained in:
Lennart Poettering
2026-06-23 22:55:23 +02:00
parent e1bdd512ed
commit f304250315
4 changed files with 59 additions and 0 deletions
+13
View File
@@ -4,6 +4,7 @@
#include <grp.h>
#include <linux/pkt_sched.h>
#include <netinet/ip.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
@@ -550,4 +551,16 @@ TEST(tos_to_priority) {
ASSERT_EQ(tos_to_priority(0xff), TC_PRIO_CONTROL);
}
TEST(socket_xattr_supported) {
int r;
r = socket_xattr_supported();
ASSERT_OK(r);
log_info("Extended attributes on socket inodes supported: %s", yes_no(r));
/* A second call must agree with the first. */
ASSERT_EQ(socket_xattr_supported(), r);
}
DEFINE_TEST_MAIN(LOG_DEBUG);