linux-um archives
 help / color / mirror / Atom feed
From: Stanislav Meduna <stano@meduna.org>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] sysconf(_SC_NPROCESSORS_CONF) returning zero
Date: Tue, 05 Aug 2008 00:06:06 +0200	[thread overview]
Message-ID: <48977D4E.4070104@meduna.org> (raw)
In-Reply-To: <20080804214731.GA18697@c2.user-mode-linux.org>

Jeff Dike wrote:

> I see it counting cpu<n> lines in /proc/stat, which is what I'm
> seeing.  It will also look at /proc/cpuinfo.  Can you strace your
> version and see if it's looking there at all?

No.. looks like they changed the method:

open("/sys/devices/system/cpu", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80
000) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
fcntl64(3, F_GETFD)                     = 0x1 (flags FD_CLOEXEC)
getdents64(3, /* 5 entries */, 4096)    = 144
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0

No reference to /proc/stat nor /proc/cpuinfo.

# ls -l /sys/devices/system/cpu
-r--r--r-- 1 root root 4096 2008-08-04 23:51 online
-r--r--r-- 1 root root 4096 2008-08-04 23:51 possible
-r--r--r-- 1 root root 4096 2008-08-04 23:51 present

# cat /sys/devices/system/cpu/online
0
# cat /sys/devices/system/cpu/possible
0
# cat /sys/devices/system/cpu/present
0


On another Linux (real, 2.6.18) this looks completely
different:

$ ls -l /sys/devices/system/cpu
total 0
drwxr-xr-x 4 root root 0 2008-08-04 23:53 cpu0


$ ls -l /sys/devices/system/cpu/cpu0/
total 0
drwxr-xr-x 5 root root    0 2007-06-11 09:30 cache
-r-------- 1 root root 4096 2008-08-04 23:53 crash_notes
drwxr-xr-x 2 root root    0 2007-06-11 09:30 topology


Well.. so this is an interface definition problem.. now who has
changet something and did not tell the others..


-- 
                                   Stano

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2008-08-04 22:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-04 13:58 [uml-devel] sysconf(_SC_NPROCESSORS_CONF) returning zero Stanislav Meduna
2008-08-04 20:33 ` Jeff Dike
2008-08-04 20:59   ` Stanislav Meduna
2008-08-04 21:47     ` Jeff Dike
2008-08-04 22:06       ` Stanislav Meduna [this message]
2008-08-04 22:07       ` Ingo van Lil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48977D4E.4070104@meduna.org \
    --to=stano@meduna.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox