Improve getprogname/setprogname #1

Open
opened 2026-01-09 06:31:33 +01:00 by xdelatour · 4 comments
Owner

Currently, setprogname do nothing and getprogname returns a litteral string (name of the binary)

Todo:

  • char *progname;
  • setprogname(n) if(!progname) progname=n
  • getprogname() return progname
Currently, setprogname do nothing and getprogname returns a litteral string (name of the binary) Todo: - char *progname; - setprogname(n) if(!progname) progname=n - getprogname() return progname
xdelatour added this to the util-mint project 2026-01-09 06:31:47 +01:00
Author
Owner

The pointer progname must point inside argv[0] to skip the path. So, getprogname return the basename

The pointer progname must point inside argv[0] to skip the path. So, getprogname return the basename
Author
Owner

Check if setprogname is called at beginning of main() (because it's automatically done on NetBSD and programs may call getprogname without setprogname)

Check if setprogname is called at beginning of main() (because it's automatically done on NetBSD and programs may call getprogname without setprogname)
Author
Owner

getprogname/setprogname are available in libnbcompat. Todo: Use this library instead of write dirty hack

getprogname/setprogname are available in libnbcompat. Todo: Use this library instead of write dirty hack
Author
Owner

crtinit.c already includes program_invocation_name and program_invocation_short_name (set from argv[0])

We just have to add related functions

crtinit.c already includes program_invocation_name and program_invocation_short_name (set from argv[0]) We just have to add related functions
Sign in to join this conversation.
No description provided.