I've got process that listen to unix socket. However, before i read, i'd like to check some meta data about this incoming message such as it's source process (say i'd like to drop messages from non trusted senders). is there any syscall that retrieve this information.
if(listen(sock_fd, 10) != 0) {
assert("listen failed");
}
while((conn_fd = accept(sock_fd,
(struct sockaddr *) &address,
&address_length)) != -1) {
int nbytes = 0;
static char buffer[PAYLOAD_SZ];
nbytes = (int)read(conn_fd, buffer, PAYLOAD_SZ);