view src/os/unix/ngx_setproctitle.h @ 3587:e1409e56ba7c stable-0.7

merge r3473, r3474, r3385, r3386, r3537: signal processing stability: *) use sys_errlist[] in signal handler instead of non Async-Signal-Safe strerror_r() *) do not update time in the timer signal handler, since localtime_r() is not Async-Signal-Safe function *) use previously cached GMT offset value to update time from a signal handler *) change ngx_time_update() interface since there are no notification methods those return time *) introduce ngx_time_sigsafe_update() to update the error log time only *) change ngx_time_update() interface
author Igor Sysoev <igor@sysoev.ru>
date Mon, 07 Jun 2010 10:35:08 +0000
parents a0a131127626
children d620f497c50f
line wrap: on
line source


/*
 * Copyright (C) Igor Sysoev
 */


#ifndef _NGX_SETPROCTITLE_H_INCLUDED_
#define _NGX_SETPROCTITLE_H_INCLUDED_


#if (NGX_HAVE_SETPROCTITLE)

/* FreeBSD, NetBSD, OpenBSD */

#define ngx_init_setproctitle(log)
#define ngx_setproctitle(title)    setproctitle("%s", title)


#else /* !NGX_HAVE_SETPROCTITLE */

#if !defined NGX_SETPROCTITLE_USES_ENV

#if (NGX_SOLARIS)

#define NGX_SETPROCTITLE_USES_ENV  1
#define NGX_SETPROCTITLE_PAD       ' '

ngx_int_t ngx_init_setproctitle(ngx_log_t *log);
void ngx_setproctitle(char *title);

#elif (NGX_LINUX) || (NGX_DARWIN)

#define NGX_SETPROCTITLE_USES_ENV  1
#define NGX_SETPROCTITLE_PAD       '\0'

ngx_int_t ngx_init_setproctitle(ngx_log_t *log);
void ngx_setproctitle(char *title);

#else

#define ngx_init_setproctitle(log)
#define ngx_setproctitle(title)

#endif /* OSes */

#endif /* NGX_SETPROCTITLE_USES_ENV */

#endif /* NGX_HAVE_SETPROCTITLE */


#endif /* _NGX_SETPROCTITLE_H_INCLUDED_ */