Skip to content

Instantly share code, notes, and snippets.

@rc5hack
Created August 15, 2013 08:56
Show Gist options
  • Save rc5hack/6239377 to your computer and use it in GitHub Desktop.
Save rc5hack/6239377 to your computer and use it in GitHub Desktop.
C program that changes it's proctitle (works on FreeBSD).
#include <stdio.h>
#include <unistd.h> // for sleep()
// Please note, that Linux does not supports setproctitle()
// (but FreeBSD does)
int main (void) {
setproctitle("I am C program! (%d)", getpid());
int MyTick=0;
puts ("Let's get some rest...");
while (MyTick < 5)
{
printf(" %d s left...\n", 5-MyTick);
sleep(1);
MyTick++;
}
printf("Hello world!\n");
return 0;
}
@danfe
Copy link

danfe commented Aug 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment