Skip to content

Commit

Permalink
libast: cleanup: remove unused/obsolete get* functions
Browse files Browse the repository at this point in the history
src/lib/libast/comp/{getlogin.c,getpgrp.c}:
- Removed. These functions have been in POSIX for decades so their
  fallbacks are never used on non-museum systems.

src/lib/libast/comp/getdate.c:
- Removed. These unconditionally overrode the OS implementations,
  but they are unused in the AT&T AST code base (2016) and in ours.

src/lib/libast/comp/{getopt.{c,h},getsubopt.c,getoptl.c},
src/lib/libast/include/ast_getopt.h:
- Removed. These reimplementations of POSIX getopt(3) and GNU
  getopt_long(3) were unused in the AT&T AST code base and in ours.

src/lib/libast/comp/getwd.c:
- Removed. Unused and obsoleted by getcwd(3) a long time ago.

src/lib/libast/comp/getgroups.c, src/lib/libast/features/botch.c:
- Removed. getgroups(2) did not have a full AST fallback, but some
  tests for system-specific getgroups bugs (in botch.c, results
  installed in ast_botch.h) with workarounds (in getgroups.c),
  which has been present since 1995 and unchanged since 1998. The
  systems where these bugs were present are not documented, but
  it's a quarter century later, and I've never seen these bugs
  detected on any system I've tested, so it seems safe to assume we
  don't need this any more.
  • Loading branch information
McDutchie committed Jul 21, 2024
1 parent 7bd5d92 commit e9278fa
Show file tree
Hide file tree
Showing 19 changed files with 5 additions and 857 deletions.
4 changes: 0 additions & 4 deletions src/cmd/INIT/mamake.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,6 @@ extern char **environ;

#if !_PACKAGE_ast

#if defined(NeXT) || defined(__NeXT)
#define getcwd(a,b) getwd(a)
#endif

/*
* emit usage message and exit
*/
Expand Down
89 changes: 3 additions & 86 deletions src/lib/libast/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,6 @@ make install virtual
exec - cp -f ${<} ${@}
done

make ast_botch.h implicit
make FEATURE/botch
make features/botch.c
prev FEATURE/sys
prev FEATURE/lib
done
exec - invoke_iffe ${<} -I. -Icomp -Iinclude -Istd
done
exec - cp -f ${<} ${@}
done

make ast_wchar.h implicit
make FEATURE/wchar
prev std/wctype.h implicit
Expand Down Expand Up @@ -342,9 +331,6 @@ make install virtual
prev FEATURE/common
prev FEATURE/lib
prev FEATURE/standards
make comp/getopt.h implicit
prev include/ast_getopt.h implicit
done
make conflim.h implicit
prev FEATURE/standards
prev FEATURE/common
Expand Down Expand Up @@ -378,12 +364,9 @@ make install virtual
prev ast_wchar.h
prev ast_common.h
done
prev comp/getopt.h
prev ast_map.h
prev ast_botch.h
prev ast_limits.h
prev ast_fcntl.h
prev include/ast_getopt.h
prev ast_sys.h
prev ast_lib.h
prev ast_common.h
Expand Down Expand Up @@ -2620,13 +2603,6 @@ make install virtual
exec - compile ${<}
done

make getlogin.o
make comp/getlogin.c
prev include/ast.h
done
exec - compile ${<}
done

make putenv.o
make comp/putenv.c
prev ast_map.h
Expand Down Expand Up @@ -2704,13 +2680,6 @@ make install virtual
exec - compile ${<}
done

make getpgrp.o
make comp/getpgrp.c
prev include/ast_std.h
done
exec - compile ${<}
done

make setpgid.o
make comp/setpgid.c
prev include/error.h
Expand Down Expand Up @@ -2766,13 +2735,6 @@ make install virtual
exec - compile ${<} -Idir
done

make getwd.o
make comp/getwd.c
prev include/ast.h
done
exec - compile ${<}
done

make dup2.o
make comp/dup2.c
prev include/error.h
Expand All @@ -2788,14 +2750,6 @@ make install virtual
exec - compile ${<}
done

make getgroups.o
make comp/getgroups.c
prev include/error.h
prev include/ast.h
done
exec - compile ${<}
done

make mount.o
make comp/mount.c
prev include/error.h
Expand Down Expand Up @@ -2986,23 +2940,6 @@ make install virtual
exec - compile ${<}
done

make getdate.o
make comp/getdate.c
prev ast_map.h
prev include/tm.h
prev include/ast.h
done
exec - compile ${<}
done

make getsubopt.o
make comp/getsubopt.c
prev include/error.h
prev include/ast.h
done
exec - compile ${<}
done

make glob.o
make misc/glob.c
prev include/glob.h implicit
Expand Down Expand Up @@ -4632,26 +4569,6 @@ make install virtual
exec - compile ${<}
done

make getopt.o
make comp/getopt.c
prev include/option.h
prev include/error.h
prev include/ast.h
done
exec - compile ${<}
done

make getoptl.o
make comp/getoptl.c
prev comp/getopt.h
prev include/option.h
prev include/error.h
prev include/ast_getopt.h
prev include/ast.h
done
exec - compile ${<}
done

make aso.o
make aso/aso.c
prev std/stdio.h
Expand Down Expand Up @@ -4926,14 +4843,14 @@ make install virtual
note * #include headers
make ${INSTALLROOT}/lib/mam/ast
note * ...main AST headers
loop HDR ast ast_dir ast_getopt ast_std ast_windows ccode cdt cmdarg debug dt error find ftwalk fts glob hash hashkey hashpart ip6 ls magic mc mime mnt modecanon modex namval option proc recfmt regex sfio sfio_s sfio_t sfdisc shcmd stk stak swap tar times tm tok usage vdb vmalloc wait magicid fnv aso
loop HDR ast ast_dir ast_std ast_windows ccode cdt cmdarg debug dt error find ftwalk fts glob hash hashkey hashpart ip6 ls magic mc mime mnt modecanon modex namval option proc recfmt regex sfio sfio_s sfio_t sfdisc shcmd stk stak swap tar times tm tok usage vdb vmalloc wait magicid fnv aso
make ${INCLUDE_AST}/${HDR}.h
prev include/${HDR}.h
exec - cp -f ${<} ${@}
done
done
note * ...comp(atibility)
loop HDR ftw getopt re_comp regexp wordexp fnmatch
loop HDR ftw re_comp regexp wordexp fnmatch
make ${INCLUDE_AST}/${HDR}.h
prev comp/${HDR}.h
exec - cp -f ${<} ${@}
Expand All @@ -4947,7 +4864,7 @@ make install virtual
done
done
note * ...generated headers
loop HDR releaseflags ast_standards ast_common ast_lib ast_sys lc align sig tmx tv ast_api ast_botch ast_ccode ast_fcntl ast_float ast_fs ast_map ast_mmap ast_mode ast_ndbm ast_param ast_random ast_time ast_tty ast_wait ast_limits ast_sizeof ast_dirent ast_iconv ast_nl_types ast_stdio ast_wchar ast_wctype
loop HDR releaseflags ast_standards ast_common ast_lib ast_sys lc align sig tmx tv ast_api ast_ccode ast_fcntl ast_float ast_fs ast_map ast_mmap ast_mode ast_ndbm ast_param ast_random ast_time ast_tty ast_wait ast_limits ast_sizeof ast_dirent ast_iconv ast_nl_types ast_stdio ast_wchar ast_wctype
make ${INCLUDE_AST}/${HDR}.h
prev ${HDR}.h
exec - cp -f ${<} ${@}
Expand Down
75 changes: 0 additions & 75 deletions src/lib/libast/comp/getdate.c

This file was deleted.

70 changes: 0 additions & 70 deletions src/lib/libast/comp/getgroups.c

This file was deleted.

34 changes: 0 additions & 34 deletions src/lib/libast/comp/getlogin.c

This file was deleted.

Loading

0 comments on commit e9278fa

Please sign in to comment.