You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The returned long corresponds to the starting address of the segment. If it is -1, that means segattach failed. I'm slightly unclear on the supported attributes. Looking through the Plan 9 source, I see that the only attributes declared in lib9.h are SG_RONLY (read only) and SG_CEXEC (detach on exec). Call sites in the linuxemu tree suggest that we should pass in SG_CEXEC into attr?
Additionally, the class name that is used is "memory". The man page states that the system will pick an address if va is 0, and I assume that len is the number of bytes desired.
So essentially,
addr := segattach(SG_CEXEC, "memory", 0, size)
if addr == -1 {
return nil, some error
}
return unsafe.Pointer(addr), nil
We should use segdetach to represent munmap, since it only takes the starting address returned by segattach.
x/sys/plan9 will let us make these syscalls. However testing this on travis will be slightly complicated. We'd probably have to run a VM inside Ubuntu.
The text was updated successfully, but these errors were encountered:
The mmap abstraction needs to be filled in for Plan 9. We should be able to use segattach to get a segment of memory from the OS.
The returned
long
corresponds to the starting address of the segment. If it is -1, that means segattach failed. I'm slightly unclear on the supported attributes. Looking through the Plan 9 source, I see that the only attributes declared in lib9.h areSG_RONLY
(read only) andSG_CEXEC
(detach on exec). Call sites in the linuxemu tree suggest that we should pass in SG_CEXEC into attr?Additionally, the class name that is used is "memory". The man page states that the system will pick an address if va is 0, and I assume that len is the number of bytes desired.
So essentially,
We should use segdetach to represent munmap, since it only takes the starting address returned by segattach.
x/sys/plan9 will let us make these syscalls. However testing this on travis will be slightly complicated. We'd probably have to run a VM inside Ubuntu.
The text was updated successfully, but these errors were encountered: