Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106107062
D1521.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D1521.diff
View Options
Index: head/sys/compat/linux/linux_time.c
===================================================================
--- head/sys/compat/linux/linux_time.c
+++ head/sys/compat/linux/linux_time.c
@@ -119,8 +119,6 @@
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, unsupported_clockid, "int");
LIN_SDT_PROBE_DEFINE1(time, linux_clock_nanosleep, return, "int");
-static int linux_to_native_clockid(clockid_t *, clockid_t);
-
void
native_to_linux_timespec(struct l_timespec *ltp, struct timespec *ntp)
@@ -151,7 +149,7 @@
return (0);
}
-static int
+int
linux_to_native_clockid(clockid_t *n, clockid_t l)
{
Index: head/sys/compat/linux/linux_timer.h
===================================================================
--- head/sys/compat/linux/linux_timer.h
+++ head/sys/compat/linux/linux_timer.h
@@ -115,5 +115,6 @@
struct timespec *);
int linux_to_native_timespec(struct timespec *,
struct l_timespec *);
+int linux_to_native_clockid(clockid_t *, clockid_t);
#endif /* _LINUX_TIMER_H */
Index: head/sys/compat/linux/linux_timer.c
===================================================================
--- head/sys/compat/linux/linux_timer.c
+++ head/sys/compat/linux/linux_timer.c
@@ -49,23 +49,6 @@
#endif
#include <compat/linux/linux_timer.h>
-static int
-linux_convert_l_clockid(clockid_t *clock_id)
-{
-
- switch (*clock_id) {
- case LINUX_CLOCK_REALTIME:
- *clock_id = CLOCK_REALTIME;
- break;
- case LINUX_CLOCK_MONOTONIC:
- *clock_id = CLOCK_MONOTONIC;
- break;
- default:
- return (EINVAL);
- }
-
- return (0);
-}
static int
linux_convert_l_sigevent(struct l_sigevent *l_sig, struct sigevent *sig)
@@ -106,6 +89,7 @@
{
struct l_sigevent l_ev;
struct sigevent ev, *evp;
+ clockid_t nwhich;
int error, id;
if (uap->evp == NULL) {
@@ -119,10 +103,10 @@
return (error);
evp = &ev;
}
- error = linux_convert_l_clockid(&uap->clock_id);
+ error = linux_to_native_clockid(&nwhich, uap->clock_id);
if (error != 0)
return (error);
- error = kern_ktimer_create(td, uap->clock_id, evp, &id, -1);
+ error = kern_ktimer_create(td, nwhich, evp, &id, -1);
if (error == 0) {
error = copyout(&id, uap->timerid, sizeof(int));
if (error != 0)
@@ -179,4 +163,3 @@
return (kern_ktimer_delete(td, uap->timerid));
}
-
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 12:37 PM (12 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15604788
Default Alt Text
D1521.diff (2 KB)
Attached To
Mode
D1521: Linuxulator. Delete the duplicate of linux_to_native_clockid() function.
Attached
Detach File
Event Timeline
Log In to Comment