Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a0879217
Commit
a0879217
authored
Mar 28, 2003
by
Yorick Hardy
Committed by
Alexandre Julliard
Mar 28, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the sysctl calls for NetBSD to determine the physical memory
available.
parent
401a9e09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
global.c
memory/global.c
+9
-6
No files found.
memory/global.c
View file @
a0879217
...
@@ -1573,9 +1573,10 @@ VOID WINAPI GlobalMemoryStatus(
...
@@ -1573,9 +1573,10 @@ VOID WINAPI GlobalMemoryStatus(
#ifdef linux
#ifdef linux
FILE
*
f
;
FILE
*
f
;
#endif
#endif
#if
def __FreeBSD__
#if
defined(__FreeBSD__) || defined(__NetBSD__)
int
*
tmp
;
int
*
tmp
;
int
size_sys
;
int
size_sys
;
int
mib
[
2
]
=
{
CTL_HW
};
#endif
#endif
if
(
time
(
NULL
)
==
cache_lastchecked
)
{
if
(
time
(
NULL
)
==
cache_lastchecked
)
{
memcpy
(
lpmem
,
&
cached_memstatus
,
sizeof
(
MEMORYSTATUS
));
memcpy
(
lpmem
,
&
cached_memstatus
,
sizeof
(
MEMORYSTATUS
));
...
@@ -1637,17 +1638,19 @@ VOID WINAPI GlobalMemoryStatus(
...
@@ -1637,17 +1638,19 @@ VOID WINAPI GlobalMemoryStatus(
/
(
TotalPhysical
/
100
);
/
(
TotalPhysical
/
100
);
}
}
}
}
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__NetBSD__)
sysctlbyname
(
"hw.physmem"
,
NULL
,
&
size_sys
,
NULL
,
0
);
mib
[
1
]
=
HW_PHYSMEM
;
sysctl
(
mib
,
2
,
NULL
,
&
size_sys
,
NULL
,
0
);
tmp
=
malloc
(
size_sys
*
sizeof
(
int
));
tmp
=
malloc
(
size_sys
*
sizeof
(
int
));
sysctl
byname
(
"hw.physmem"
,
tmp
,
&
size_sys
,
NULL
,
0
);
sysctl
(
mib
,
2
,
tmp
,
&
size_sys
,
NULL
,
0
);
if
(
tmp
&&
*
tmp
)
if
(
tmp
&&
*
tmp
)
{
{
lpmem
->
dwTotalPhys
=
*
tmp
;
lpmem
->
dwTotalPhys
=
*
tmp
;
free
(
tmp
);
free
(
tmp
);
sysctlbyname
(
"hw.usermem"
,
NULL
,
&
size_sys
,
NULL
,
0
);
mib
[
1
]
=
HW_USERMEM
;
sysctl
(
mib
,
2
,
NULL
,
&
size_sys
,
NULL
,
0
);
tmp
=
malloc
(
size_sys
*
sizeof
(
int
));
tmp
=
malloc
(
size_sys
*
sizeof
(
int
));
sysctl
byname
(
"hw.usermem"
,
tmp
,
&
size_sys
,
NULL
,
0
);
sysctl
(
mib
,
2
,
tmp
,
&
size_sys
,
NULL
,
0
);
if
(
tmp
&&
*
tmp
)
if
(
tmp
&&
*
tmp
)
{
{
lpmem
->
dwAvailPhys
=
*
tmp
;
lpmem
->
dwAvailPhys
=
*
tmp
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment