mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
Make setproctitle() available in 0.2 and 0.5 version nodes
Make the 0.5 version the default, so that code wanting the actual implemented version can get a proper versioned depdendency. For code linked against the old version, make it available as an alias.
This commit is contained in:
parent
c984dacd65
commit
e9933255d4
@ -38,6 +38,7 @@ AC_CHECK_HEADERS([sys/ndir.h sys/dir.h dir.h dirent.h])
|
|||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_TYPE_UID_T
|
AC_TYPE_UID_T
|
||||||
AC_C_INLINE
|
AC_C_INLINE
|
||||||
|
AC_C_TYPEOF
|
||||||
AC_TYPE_INT64_T
|
AC_TYPE_INT64_T
|
||||||
AC_TYPE_MODE_T
|
AC_TYPE_MODE_T
|
||||||
AC_TYPE_OFF_T
|
AC_TYPE_OFF_T
|
||||||
|
@ -73,8 +73,6 @@ LIBBSD_0.2 {
|
|||||||
pidfile_close;
|
pidfile_close;
|
||||||
pidfile_remove;
|
pidfile_remove;
|
||||||
|
|
||||||
setproctitle;
|
|
||||||
|
|
||||||
arc4random_buf;
|
arc4random_buf;
|
||||||
arc4random_uniform;
|
arc4random_uniform;
|
||||||
} LIBBSD_0.1;
|
} LIBBSD_0.1;
|
||||||
@ -99,6 +97,9 @@ LIBBSD_0.5 {
|
|||||||
fgetwln;
|
fgetwln;
|
||||||
fparseln;
|
fparseln;
|
||||||
|
|
||||||
|
/* Introduced in 0.2 as a stub, implemented in 0.5. */
|
||||||
|
setproctitle;
|
||||||
|
|
||||||
strnstr;
|
strnstr;
|
||||||
|
|
||||||
wcslcat;
|
wcslcat;
|
||||||
|
@ -191,7 +191,7 @@ spt_init(int argc, char *argv[], char *envp[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
setproctitle(const char *fmt, ...)
|
setproctitle_impl(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
/* Use buffer in case argv[0] is passed. */
|
/* Use buffer in case argv[0] is passed. */
|
||||||
char buf[SPT_MAXTITLE + 1];
|
char buf[SPT_MAXTITLE + 1];
|
||||||
@ -243,3 +243,13 @@ setproctitle(const char *fmt, ...)
|
|||||||
*++nul = '\0';
|
*++nul = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
__asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
|
||||||
|
|
||||||
|
#ifdef HAVE_TYPEOF
|
||||||
|
/* The original function introduced in 0.2 was a stub, it only got implemented
|
||||||
|
* in 0.5, make the implementation available in the old version as an alias
|
||||||
|
* for code linking against that version, and change the default to use the
|
||||||
|
* new version, so that new code depends on the implemented version. */
|
||||||
|
extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
|
||||||
|
__asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user