From a969564af44d182ef813b5f21cb34ad8d76c7bec Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 26 Jul 2020 00:09:53 +0200 Subject: [PATCH] Delete inet_addr(3) and inet_ntoa(3). --- doc/obsolete-stuff | 8 -------- libc/Makefile | 2 -- libc/arpa/inet/inet_addr.c | 32 -------------------------------- libc/arpa/inet/inet_ntoa.c | 32 -------------------------------- libc/include/arpa/inet.h | 8 -------- 5 files changed, 82 deletions(-) delete mode 100644 libc/arpa/inet/inet_addr.c delete mode 100644 libc/arpa/inet/inet_ntoa.c diff --git a/doc/obsolete-stuff b/doc/obsolete-stuff index 177ab57d..49cbb2ff 100644 --- a/doc/obsolete-stuff +++ b/doc/obsolete-stuff @@ -156,20 +156,12 @@ This function only supports IPv4 and it supports a variety of weird ways to type IPv4 addresses. Use inet_pton instead, which supports other address families as well and only support standard address notations. -Soritx currently implements a stub of this function that calls abort(), this is -for compatibility to get some ports to compile (the ports should be patched to -use inet_pton instead). - inet_ntoa --------- This function only supports IPv4 and it isn't thread safe. Use inet_ntop instead which is thread safe and supports other address families. -Soritx currently implements a stub of this function that calls abort(), this is -for compatibility to get some ports to compile (the ports should be patched to -use inet_ntop instead). - lockf ----- diff --git a/libc/Makefile b/libc/Makefile index f753437d..1856fe06 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -327,8 +327,6 @@ wctype/towupper.o \ wctype/wctype.o \ HOSTEDOBJS=\ -arpa/inet/inet_addr.o \ -arpa/inet/inet_ntoa.o \ blf/blowfish.o \ $(CPUDIR)/fork.o \ $(CPUDIR)/setjmp.o \ diff --git a/libc/arpa/inet/inet_addr.c b/libc/arpa/inet/inet_addr.c deleted file mode 100644 index fb4c72c1..00000000 --- a/libc/arpa/inet/inet_addr.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2013 Jonas 'Sortie' Termansen. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * arpa/inet/inet_addr.c - * Internet address manipulation routines. - */ - -#include -#include -#include - -#include -#include - -in_addr_t inet_addr(const char* cp) -{ - (void) cp; - fprintf(stderr, "%s is not implemented yet, aborting.\n", __func__); - abort(); -} diff --git a/libc/arpa/inet/inet_ntoa.c b/libc/arpa/inet/inet_ntoa.c deleted file mode 100644 index dc9fda9b..00000000 --- a/libc/arpa/inet/inet_ntoa.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2013 Jonas 'Sortie' Termansen. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * arpa/inet/inet_ntoa.c - * Internet address manipulation routines. - */ - -#include -#include -#include - -#include -#include - -char* inet_ntoa(struct in_addr in) -{ - (void) in; - fprintf(stderr, "%s is not implemented yet, aborting.\n", __func__); - abort(); -} diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h index 80350895..a3f3b835 100644 --- a/libc/include/arpa/inet.h +++ b/libc/include/arpa/inet.h @@ -28,14 +28,6 @@ extern "C" { #endif -/* Functions from POSIX that is considered obsolete due to bad design. */ -#if __USE_SORTIX || __USE_POSIX -__attribute__((__warning__("inet_addr is deprecated by inet_pton"))) -in_addr_t inet_addr(const char*); -__attribute__((__warning__("inet_ntoa is deprecated by inet_ntop"))) -char* inet_ntoa(struct in_addr); -#endif - /* Functions from POSIX. */ #if __USE_SORTIX || __USE_POSIX const char* inet_ntop(int, const void* __restrict, char* __restrict, socklen_t);