Package: libsysfs2
Version: 2.0.0-7
Severity: normal
Hi,
on my system, this code:
#include <sysfs/libsysfs.h>
#include <stdio.h>
int main(void){
struct dlist *sf_dev_list;
struct sysfs_class_device *sf_dev;
sf_dev_list = sysfs_get_class_devices(sysfs_open_class("input"));
dlist_for_each_data(sf_dev_list, sf_dev, struct sysfs_class_device) {
printf("name: %s\npath: %s\n", sf_dev->name, sf_dev->path);
if(sysfs_path_is_link(sf_dev->path)) printf("link!\n");
sysfs_close_class_device(sf_dev);
}
}
produces this output:
name: event0
path: /sys/class/input/input0/event0
link!
name: event1
path: /sys/class/input/input1/event1
link!
name: event2
path: /sys/class/input/input2/event2
link!
name: event3
path: /sys/class/input/input3/event3
link!
name: event4
path: /sys/class/input/input4/event4
link!
name: input0
path: /sys/class/input/input0
link!
name: input1
path: /sys/class/input/input1
link!
name: input2
path: /sys/class/input/input2
link!
name: input3
path: /sys/class/input/input3
link!
name: input4
path: /sys/class/input/input4
link!
name: mice
path: /sys/class/input/mice
link!
name: mouse0
path: /sys/class/input/input0/mouse0
link!
name: mouse1
path: /sys/class/input/input3/mouse1
link!
while the answer is correct for event[1-4] and mouse[0-1] it isn't for
input[0-4], or I'm missing something:
total 0
drwxr-xr-x 8 root root 0 2006-06-13 15:27 .
drwxr-xr-x 25 root root 0 2006-06-13 10:00 ..
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 event0 ->
../../class/input/input0/event0
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 event1 ->
../../class/input/input1/event1
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 event2 ->
../../class/input/input2/event2
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 event3 ->
../../class/input/input3/event3
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 event4 ->
../../class/input/input4/event4
drwxr-xr-x 6 root root 0 2006-06-13 14:26 input0
drwxr-xr-x 5 root root 0 2006-06-13 10:00 input1
drwxr-xr-x 5 root root 0 2006-06-13 10:00 input2
drwxr-xr-x 6 root root 0 2006-06-13 10:00 input3
drwxr-xr-x 5 root root 0 2006-06-13 10:00 input4
drwxr-xr-x 2 root root 0 2006-06-13 10:00 mice
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 mouse0 ->
../../class/input/input0/mouse0
lrwxrwxrwx 1 root root 0 2006-06-13 15:27 mouse1 ->
../../class/input/input3/mouse1
thanks in advance,
filippo
-- System Information:
Debian Release: testing/unstable
APT prefers experimental
APT policy: (650, 'experimental'), (600, 'unstable')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16.9
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Versions of packages libsysfs2 depends on:
ii libc6 2.3.999.2-3 GNU C Library: Shared libraries
libsysfs2 recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]