summaryrefslogtreecommitdiff
path: root/libc/config
diff options
context:
space:
mode:
authorMichael Jones <michaelrj@google.com>2023-04-24 16:55:54 -0700
committerMichael Jones <michaelrj@google.com>2023-05-03 11:01:11 -0700
commitee17fd7d46a914bed4619f656cc9062c40951e5c (patch)
tree673605e2495245a9d0510202bc3996db907126ad /libc/config
parentfc19204918136074483e576177e05bccb2543d44 (diff)
downloadllvm-ee17fd7d46a914bed4619f656cc9062c40951e5c.tar.gz
[libc] add socket function
This patch adds the function "socket" from the header "sys/socket". It's a simple syscall wrapper, and I plan on adding the related functions in a followup patch. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D149622
Diffstat (limited to 'libc/config')
-rw-r--r--libc/config/linux/api.td4
-rw-r--r--libc/config/linux/x86_64/entrypoints.txt3
2 files changed, 7 insertions, 0 deletions
diff --git a/libc/config/linux/api.td b/libc/config/linux/api.td
index 8fac4e041f1b..4aa06c7845e1 100644
--- a/libc/config/linux/api.td
+++ b/libc/config/linux/api.td
@@ -203,6 +203,10 @@ def SysSelectAPI : PublicAPI<"sys/select.h"> {
"struct timeval"];
}
+def SysSocketAPI : PublicAPI<"sys/socket.h"> {
+ let Types = ["struct sockaddr", "sa_family_t"];
+}
+
def SysResourceAPI : PublicAPI<"sys/resource.h"> {
let Types = ["rlim_t", "struct rlimit"];
}
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 5ac24c6daade..532a7dc72d84 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -145,6 +145,9 @@ set(TARGET_LIBC_ENTRYPOINTS
# sys/sendfile entrypoints
libc.src.sys.sendfile.sendfile
+ # sys/socket.h entrypoints
+ libc.src.sys.socket.socket
+
# sys/stat.h entrypoints
libc.src.sys.stat.chmod
libc.src.sys.stat.fchmod