Opened 16 years ago
Last modified 4 years ago
#3207 new enhancement
implement <utmpx.h>
Reported by: | kaliber | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | System/POSIX | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
It would be nice to have utmpx support in haiku: http://www.opengroup.org/onlinepubs/009695399/basedefs/utmpx.h.html
Attachments (2)
Change History (19)
comment:1 by , 15 years ago
Component: | System/libroot.so → System/POSIX |
---|---|
Owner: | changed from | to
comment:2 by , 14 years ago
comment:3 by , 12 years ago
I think this should do the work:
/* As of now, Haiku doesnt have multiuser support, this header provides a stub implementation */ #include <sys/types.h> #include <sys/time.h>
struct utmpx {
char ut_user[]; /* User login name */ char ut_it[]; /* Unspecified initialization process identifier. */ char ut_line[]; /* Device name */ pid_t ut_id; /* Process ID */ short ut_type; /* Type of entry */ struct timeval ut_tv; /* Time entry was made */
}
/* Symbolic constants for ut_type */ #define EMPTY 0 /* No valid user accounting information. */ #define BOOT_TIME 1 /* Identifies time of system boot. */ #define OLD_TIME 2 /* Identifies time when system clock changed. */ #define NEW_TIME 3 /* Identifies time after system clock changed. */ #define USER_PROCESS 4 /* Identifies a process. */ #define INIT_PROCESS 5 /* Identifies a process spawned by the init process. */ #define LOGIN_PROCESS 6 /* Identifies the session leader of a logged-in user */ #define DEAD_PROCESS 7 /* Identifies a session leader who has exited. */
void endutxent(void); struct utmpx *getutxent(void); struct utmpx *getutxid(const struct utmpx *); struct utmpx *getutxline(const struct utmpx *); struct utmpx *pututxline(const struct utmpx *); void setutxent(void);
comment:4 by , 12 years ago
Please use the GCI task page for communication with your mentors. AFAIK results of your work should be provided as standard git formatted patches. Read "git format-patch help" for more info. So please avoid publishing raw code as ticket comments. Thank you.
by , 12 years ago
Attachment: | 0001-Add-a-stub-implementation-for-utmpx.h.patch added |
---|
comment:5 by , 12 years ago
patch: | 0 → 1 |
---|
comment:6 by , 12 years ago
patch: | 1 → 0 |
---|
by , 12 years ago
Attachment: | 0001-Added-stub-implementation-for-utmpx.h.patch added |
---|
comment:7 by , 12 years ago
patch: | 0 → 1 |
---|
follow-up: 9 comment:8 by , 12 years ago
A few general remarks:
- I don't see any point in having a stub implementation. The only effect this will have is that the configure script of ported software packages that can make use of this functionality will think Haiku provides it, although it actually doesn't.
- Haiku does have basic support for multi-user. Besides that the kernel doesn't enforce all user permissions correctly (most FSs actually do, but in other places users may do things they shouldn't be allowed to) the needed parts should mostly be in place. We're missing certain APIs (like this user accounting database stuff) and at the system application level (servers) there's quite a bit to be done to make it work despite enforced user permissions.
- The pointer style
type* foo
should be preferred overtype *foo
.
follow-ups: 10 11 comment:9 by , 12 years ago
Replying to bonefish:
- I don't see any point in having a stub implementation.
I'm completely agree with you. Unfortunately I have cleared all details of this problem after the student has already claimed the task and started implementation in stub variant. :-(
But if you find the full-blown implementation reasonable at the current moment - the follow-up GCI task can be created - to finish this implementation. But, please, share in this case your vision about implementation details. Thanks.
comment:10 by , 12 years ago
Replying to siarzhuk:
Replying to bonefish:
- I don't see any point in having a stub implementation.
I'm completely agree with you. Unfortunately I have cleared all details of this problem after the student has already claimed the task and started implementation in stub variant. :-(
But if you find the full-blown implementation reasonable at the current moment - the follow-up GCI task can be created - to finish this implementation. But, please, share in this case your vision about implementation details. Thanks.
I am working on a full-blown implementation for utmpx.h. You can create a follow-up task on the latter and post it's link here. I will be more than happy to provide you with the patches :)
follow-up: 14 comment:11 by , 12 years ago
Replying to siarzhuk:
But if you find the full-blown implementation reasonable at the current moment - the follow-up GCI task can be created - to finish this implementation. But, please, share in this case your vision about implementation details. Thanks.
I don't have a vision about the implementation ATM. I have a rough idea of the purpose of the user accounting functionality -- from which I would say that it can be implemented in the current Haiku -- but I don't know any details. A reasonable approach would be to first find out, how this DB is actually used. I don't mean the API -- the POSIX specs cover that -- but which program/component uses the API when and how. Also, there are no removal operations in the API, so the DB must either be cleared and/or culled at some point (at boot?).
Once all that is clear, we can think of how an appropriate implementation could look like on Haiku.
comment:12 by , 10 years ago
Milestone: | R1 → Unscheduled |
---|
Move POSIX compatibility related tickets out of R1 milestone (FutureHaiku/Features).
comment:14 by , 9 years ago
Replying to bonefish:
Replying to siarzhuk:
I don't have a vision about the implementation ATM. I have a rough idea of the purpose of the user accounting functionality -- from which I would say that it can be implemented in the current Haiku -- but I don't know any details. A reasonable approach would be to first find out, how this DB is actually used. I don't mean the API -- the POSIX specs cover that -- but which program/component uses the API when and how. Also, there are no removal operations in the API, so the DB must either be cleared and/or culled at some point (at boot?).
Once all that is clear, we can think of how an appropriate implementation could look like on Haiku.
When you say "which program/component uses the API when and how", you mean we should define which native Haiku components (IE: Servers and applications) should update the db and how and when ?
comment:15 by , 7 years ago
patch: | 1 → 0 |
---|
comment:16 by , 4 years ago
OpenJDK14 thinks this is POSIX and expects header and symbols, functional isn't required. https://review.haiku-os.org/c/haiku/+/3371
comment:17 by , 4 years ago
Header and symbols merged in hrev54720. Lynx seems to be affected... see https://github.com/haikuports/haikuports/pull/5772
FreeBSD already did it
http://lists.freebsd.org/pipermail/freebsd-current/2010-January/014893.html