Re: sockets in kernel space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

it's me again. sock_create works now, but now I have problems to bind the 
socket to the name I want it to have.

--- code ---

struct socket *guestsock;
struct sockaddr_un sun;
int error;
sock_create(PF_UNIX, SOCK_DGRAM, 0, &guestsock);
sun.sun_family = AF_UNIX;
strncpy (sun.sun_path, GUESTSOCKET, sizeof (GUESTSOCKET));
error = guestsock->ops->bind(guestsock,(struct sockaddr*)&sun,sizeof(sun));
if (error<0) {
        perror("socket thread: can't bind guest socket");
}

--- /code ---

gives my a "socket thread: can't bind guest socket: Operation not permitted" 
with a errno of -2, when GUESTSOCKET is /tmp/guestsocket. It seams to work 
when I use \0guestsocket. But that seams to be a so called abstract name 
and I don't know who to handle that. Could someone please help me?


Thanks for your answer,
Patrick "Petschge" Kilian

-- 
If there was a country that didn't suck, it would quickly develop
a population problem, much like a hard vacuum causes spontaneous
generation of elementary particles.     -- Jasper Janssen in a.s.r.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux