Bug 75049

Summary: get_nprocs_conf() is not portable
Product: Zeitgeist Reporter: Ting-Wei Lan <lantw44>
Component: libzeitgeistAssignee: zeitgeist-bugs <zeitgeist-bugs>
Status: RESOLVED FIXED QA Contact: zeitgeist-bugs <zeitgeist-bugs>
Severity: normal    
Priority: medium CC: ajacoutot
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Replace get_nprocs_conf with sysconf(_SC_NPROCESSORS_CONF)

Description Ting-Wei Lan 2014-02-16 10:51:36 UTC
Created attachment 94156 [details]
Replace get_nprocs_conf with sysconf(_SC_NPROCESSORS_CONF)

get_nprocs_conf is only available on GNU/Linux. According to the man pages, it is the same as sysconf(_SC_NPROCESSORS_CONF), so we should use it instead.
Comment 1 Ting-Wei Lan 2014-02-16 10:55:30 UTC
Comment on attachment 94156 [details]
Replace get_nprocs_conf with sysconf(_SC_NPROCESSORS_CONF)

Sorry, I found _SC_NPROCESSORS_CONF is also not standard. We should find a better way to replace get_nprocs_conf, and we cannot use this patch.
Comment 2 Antoine Jacoutot 2014-02-16 22:48:48 UTC
Sqme bug was opened there almost a year ago...
https://bugs.launchpad.net/libzeitgeist/+bug/1161565
(with a similar patch)
Comment 3 Allison Lortie (desrt) 2014-02-28 15:29:52 UTC
g_get_num_processors()
Comment 4 Seif Lotfy 2014-03-04 19:57:21 UTC
pushed fix to master

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.