aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 15:36:17 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 15:36:17 +0000
commita745ec6d91fc3ee06b4c281d30b472aeaa6302e0 (patch)
treea2dec5b590f8e3c9846eac199caa4aa53541df66 /linux-user/syscall.c
parentf0b86b144830ce2553e2c470aeed1d7b16bfd68b (diff)
downloadqemu-a745ec6d91fc3ee06b4c281d30b472aeaa6302e0.zip
qemu-a745ec6d91fc3ee06b4c281d30b472aeaa6302e0.tar.gz
qemu-a745ec6d91fc3ee06b4c281d30b472aeaa6302e0.tar.bz2
Update ARM rt_frame layout.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4365 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a62bd9b..0e506cc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3054,6 +3054,37 @@ static inline abi_long host_to_target_timespec(abi_ulong target_addr,
unlock_user_struct(target_ts, target_addr, 1);
}
+int get_osversion(void)
+{
+ static int osversion;
+ struct new_utsname buf;
+ const char *s;
+ int i, n, tmp;
+ if (osversion)
+ return osversion;
+ if (qemu_uname_release && *qemu_uname_release) {
+ s = qemu_uname_release;
+ } else {
+ if (sys_uname(&buf))
+ return 0;
+ s = buf.release;
+ }
+ tmp = 0;
+ for (i = 0; i < 3; i++) {
+ n = 0;
+ while (*s >= '0' && *s <= '9') {
+ n *= 10;
+ n += *s - '0';
+ s++;
+ }
+ tmp = (tmp << 8) + n;
+ if (*s == '.')
+ s++;
+ }
+ osversion = tmp;
+ return osversion;
+}
+
/* do_syscall() should always have a single exit point at the end so
that actions, such as logging of syscall results, can be performed.
All errnos that do_syscall() returns must be -TARGET_<errcode>. */