Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Functions
setproctitle.c File Reference
`#include "ruby.h"`
`#include "ruby/util.h"`
`#include <stdarg.h>`
`#include <stdlib.h>`
`#include <string.h>`

Go to the source code of this file.

## Macros
#define | compat_init_setproctitle ruby_init_setproctitle
#define | SPT_NONE 0 /* don't use it at all */
#define | SPT_PSTAT 1 /* use pstat(PSTAT_SETCMD, ...) */
#define | SPT_REUSEARGV 2 /* cover argv with title information */
#define | SPT_TYPE SPT_NONE
#define | SPT_PADCHAR '\0'

## Functions
RUBY_FUNC_EXPORTED void | ruby_init_setproctitle (int argc, char *argv[])
void | compat_init_setproctitle (int argc, char *argv[])
void | setproctitle (const char *fmt,...)

## Macro Definition Documentation

## ◆ compat_init_setproctitle

#define compat_init_setproctitle ruby_init_setproctitle

Definition at line 37 of file setproctitle.c.

## ◆ SPT_NONE

#define SPT_NONE 0 /* don't use it at all */

Definition at line 62 of file setproctitle.c.

## ◆ SPT_PADCHAR

#define SPT_PADCHAR '\0'

Definition at line 71 of file setproctitle.c.

## ◆ SPT_PSTAT

#define SPT_PSTAT 1 /* use pstat(PSTAT_SETCMD, ...) */

Definition at line 63 of file setproctitle.c.

## ◆ SPT_REUSEARGV

#define SPT_REUSEARGV 2 /* cover argv with title information */

Definition at line 64 of file setproctitle.c.

## ◆ SPT_TYPE

#define SPT_TYPE SPT_NONE

Definition at line 67 of file setproctitle.c.

## Function Documentation

## ◆ compat_init_setproctitle()

void compat_init_setproctitle | ( | int | argc,
|  | char * | argv[]
| ) |  |

Definition at line 84 of file setproctitle.c.

References argc, argv, calloc(), environ, i, NULL, ruby_strdup(), and strlen().

## ◆ ruby_init_setproctitle()

RUBY_FUNC_EXPORTED void ruby_init_setproctitle | ( | int | argc,
|  | char * | argv[]
| ) |  |

## ◆ setproctitle()

void setproctitle | ( | const char * | fmt,
|  |  | ...
| ) |  |

Definition at line 139 of file setproctitle.c.

References fmt, len, NULL, SPT_PADCHAR, strlcpy(), strlen(), va_end, va_start, and vsnprintf().