~ubuntu-branches/ubuntu/hardy/xfsprogs/hardy

« back to all changes in this revision

Viewing changes to libxfs/freebsd.c

  • Committer: Bazaar Package Importer
  • Author(s): Niv Sardi
  • Date: 2007-11-01 15:05:23 UTC
  • mfrom: (6.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071101150523-voy4azhdto6fh1sx
Tags: 2.9.4-2
* Rebuild in a clean chroot (closes: 448704)
* Add myself as Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <sys/disk.h>
22
22
#include <sys/mount.h>
23
23
#include <sys/ioctl.h>
 
24
#include <sys/sysctl.h>
24
25
 
25
26
int platform_has_uuid = 1;
26
27
extern char *progname;
149
150
        *bsz = (int)ssize;
150
151
}
151
152
 
152
 
/* ARGSUSED */
153
 
int
154
 
platform_aio_init(int aio_count)
155
 
{
156
 
        return 0;               /* aio/lio_listio not available */
157
 
}
158
 
 
159
153
char *
160
154
platform_findrawpath(char *path)
161
155
{
183
177
int
184
178
platform_nproc(void)
185
179
{
186
 
        return 1;
 
180
        int             ncpu;
 
181
        size_t          len = sizeof(ncpu);
 
182
        static int      mib[2] = {CTL_HW, HW_NCPU};
 
183
 
 
184
        if (sysctl(mib, 2, &ncpu, &len, NULL, 0) < 0)
 
185
                ncpu = 1;
 
186
 
 
187
        return ncpu;
 
188
}
 
189
 
 
190
unsigned long
 
191
platform_physmem(void)
 
192
{
 
193
        unsigned long   physmem;
 
194
        size_t          len = sizeof(physmem);
 
195
        static int      mib[2] = {CTL_HW, HW_PHYSMEM};
 
196
 
 
197
        if (sysctl(mib, 2, &physmem, &len, NULL, 0) < 0) {
 
198
                fprintf(stderr, _("%s: can't determine memory size\n"),
 
199
                        progname);
 
200
                exit(1);
 
201
        }
 
202
        return physmem >> 10;
187
203
}