copy slave_name to buffer
#define _XOPEN_SOURCE
pull from upstream