aboutsummaryrefslogtreecommitdiffstats
path: root/src/libenvexec/prog_pid_fill.c
blob: cec63b851acb210f37f0a00e7ce6c0e29c2afc38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <string.h>
#include <unistd.h>

#include <skalibs/types.h>
#include <skalibs/prog.h>

void prog_pid_fill (char *s, char const *name, size_t len)
{
  memcpy(s, name, len) ; s += len ;
  memcpy(s, ": pid ", 6) ; s += 6 ;
  s += pid_fmt(s, getpid()) ;
  *s++ = 0 ;
}