[lkml]   [2001]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: No buffer space available??
Mathieu Dube wrote:
> when accept return -1 perror gives me "No buffer space available"
> What do you think that means??

Better ask a real net guru :-)
Or look at the sources.

in /usr/src/linux/net/ipv4/af_inet.c

int inet_create() {
sk = sk_alloc(PF_INET, GFP_KERNEL, 1);
if (sk == NULL)
goto do_oom;
return -ENOBUFS;

in /usr/src/linux/net/core/sock.c

* All socket objects are allocated here. This is for future
* usage.

struct sock *sk_alloc(int family, int priority, int zero_it)
struct sock *sk = kmem_cache_alloc(sk_cachep, priority);

if(sk) {
if (zero_it)
memset(sk, 0, sizeof(struct sock));
sk->family = family;

return sk;

void __init sk_init(void)
sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0,


Poking around a little in mm/slab.c, I see that the name passed to
kmem_cache_create is used in generating the /proc/slabinfo report, so
cat /proc/slabinfo | grep sock
shows you some info. On my system, it prints two numbers, from
len += sprintf(buf+len, "%-17s %6lu %6lu\n", cachep->c_name, active_objs, num_objs);
which tells you how many sockets are allocated. Dunno how useful that is.

Like I said, you'll have to ask a real guru :-)

- Dan
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:56    [W:0.045 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site