hurd does not compile
So as the title suggests hurd from git.sv.gnu.org/hurd/ does not compile for me, but hurd-0.5 from ftp.gnu.org/gnu/ does. The message I am getting is ~/hurd/exec/exec.c:1173: undefined reference to `task_set_name' collect2: error: ld returned 1 exit status make[1]: *** [exec] Error 1 make[1]: Leaving directory `/home/me/hurd/exec' make: *** [exec] Error 2 can anyone tell me what is going on with this error message? I am compiling this in a debian hurd qemu image. If you respond could you also include your IRC nick is so I can bug in the chatroom, mine is Petroz. signature.asc Description: This is a digitally signed message part
Re: hurd does not compile
Hi Peter :) Quoting Peter Baumgarten (2014-03-12 08:00:35) > So as the title suggests hurd from git.sv.gnu.org/hurd/ does not compile > for me, but hurd-0.5 from ftp.gnu.org/gnu/ does. The message I am > getting is > > ~/hurd/exec/exec.c:1173: undefined reference to `task_set_name' > collect2: error: ld returned 1 exit status > make[1]: *** [exec] Error 1 > make[1]: Leaving directory `/home/me/hurd/exec' > make: *** [exec] Error 2 > > can anyone tell me what is going on with this error message? task_set_name is a new rpc that was added to gnumach recently: http://git.sceen.net/hurd/gnumach.git/commitdiff/877a319c94619e51a0103b9f201523b269588eb0 Unfortunately, the client side rpc stub has not made it into whatever library that the client stubs for the kernel are supposed to go (I'm not sure where myself... libc?). Until this happens (hopefully soon), you can use this patch: http://lists.gnu.org/archive/html/bug-hurd/2014-02/msg00146.html > I am compiling this in a debian hurd qemu image. If you respond > could you also include your IRC nick is so I can bug in the > chatroom, mine is Petroz. My nick is teythoon. See you in #hurd ;) Justus
Re: hurd does not compile
Justus Winter, le Wed 12 Mar 2014 11:15:04 +0100, a écrit : > http://git.sceen.net/hurd/gnumach.git/commitdiff/877a319c94619e51a0103b9f201523b269588eb0 > > Unfortunately, the client side rpc stub has not made it into whatever > library that the client stubs for the kernel are supposed to go (I'm > not sure where myself... libc?). I's actually the Mach headers which need to be upgraded to the version which includes task_set_name, and glibc then recompiled against it. Samuel
Re: New installation CDs and qemu image
Hi, Samuel Thibault wrote: Or simpler: dpkg-reconfigure hurd I remounted read-write /, run it and it complted. Now I have a nicely populated /proc ! However, my /run is still empty. Something else to reconfigure perhaps? Needles to say, i still get the boot failure about fsck complaining the volume being mounted. I could try to comment out the line in /etc/fstab, for a root login the homes are not needed anyway, right? At least to see if that is the "only" problem. My installation complteded (except for the final volume unmounting) without hiccups, so I hope the system is actually complete. Riccardo
[PATCH 3/8] mach-defpager: add and use synchronized_printf for dprintf
* mach-defpager/default_pager.c (synchronized_printf): New function. (printf_lock): Move to synchronized_printf. (dprintf): Use synchronized_printf. (ddprintf): Likewise. --- mach-defpager/default_pager.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index df0200d..ebbff60 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -51,6 +51,7 @@ #include #include #include +#include #include @@ -63,24 +64,30 @@ static char my_name[] = "(default pager):"; -static pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; +static void __attribute__ ((format (printf, 1, 2), unused)) +synchronized_printf (const char *fmt, ...) +{ + static pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; + va_list ap; + + va_start (ap, fmt); + pthread_mutex_lock (&printf_lock); + + vprintf (fmt, ap); + fflush (stdout); + + pthread_mutex_unlock (&printf_lock); + va_end (ap); +} #if 0 -#define dprintf(f, x...) \ - ({ pthread_mutex_lock (&printf_lock);\ - printf (f , ##x); \ - fflush (stdout); \ - pthread_mutex_unlock (&printf_lock); }) +#define dprintf(f, x...) synchronized_printf (f, ##x) #else #define dprintf(f, x...) #endif #if 0 -#define ddprintf(f, x...) \ - ({ pthread_mutex_lock (&printf_lock);\ - printf (f , ##x); \ - fflush (stdout); \ - pthread_mutex_unlock (&printf_lock); }) +#define ddprintf(f, x...) synchronized_printf (f, ##x) #else #define ddprintf(f, x...) #endif -- 1.9.0
[PATCH 1/8] mach-defpager: remove comments around form feeds
Form feed characters (\f) are whitespace and are treated as such by c compilers. There is no need to enclose them in comments. * mach-defpager/default_pager.c: Remove comments around form feeds. --- mach-defpager/default_pager.c | 13 - 1 file changed, 13 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 0977a5d..bea23b1 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -98,10 +98,7 @@ static pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; #defineptoa(p) ((p)*vm_page_size) #defineatop(a) ((a)/vm_page_size) - -/* - */ /* * Bitmap allocation. */ @@ -627,10 +624,7 @@ ddprintf ("pager_dealloc_page(%d,%x,%d)\n",pindex,page,lock_it); if (lock_it) pthread_mutex_unlock(&part->p_lock); } - -/* - */ /* * Allocation info for each paging object. * @@ -1706,11 +1700,7 @@ ok: pager->cur_partition = choose_partition(0, P_INDEX_INVALID); return TRUE; } - -/* - */ - /* * Read/write routines. */ @@ -1888,10 +1878,7 @@ default_has_page(ds, offset) { return ( ! no_block(pager_read_offset(ds, offset)) ); } -/* - */ - /* * Mapping between pager port and paging object. */ -- 1.9.0
[PATCH 5/8] mach-defpager: fix warning about uninitialized variable
Previously, failure to look up the given partition was detected after the loop by checking whether the loop ran over all existing partitions. Initialize part to NULL and check for that instead. This retains the behavior, but expresses it in a way the compiler understands better. * mach-defpager/default_pager.c (destroy_paging_partition): Initialize part to NULL and check for it still being NULL after the loop. --- mach-defpager/default_pager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 33d72b3..1b9d511 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -1991,7 +1991,7 @@ destroy_paging_partition(name, pp_private) void **pp_private; { unsigned intid = part_id(name); - partition_t part; + partition_t part = NULL; boolean_t all_ok = TRUE; default_pager_t entry; int pindex; @@ -2006,7 +2006,7 @@ destroy_paging_partition(name, pp_private) part = partition_of(pindex); if (part && (part->id == id)) break; } - if (pindex == all_partitions.n_partitions) { + if (! part) { pthread_mutex_unlock(&all_partitions.lock); return KERN_INVALID_ARGUMENT; } -- 1.9.0
[PATCH 2/8] mach-defpager: fix warnings about unused variables
* mach-defpager/default_pager.c (pager_alloc): Declare variables only when needed. (dealloc_direct): Remove unused variables. (seqnos_memory_object_terminate): Remove unused variable, adjust ddprintfs accordingly. (seqnos_memory_object_data_write): Remove unused variable. --- mach-defpager/default_pager.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index bea23b1..df0200d 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -753,7 +753,9 @@ pager_alloc(pager, part, size) vm_size_t size; /* in BYTES */ { inti; +#ifdef CHECKSUM dp_map_t mapptr, emapptr; +#endif pthread_mutex_init(&pager->lock, NULL); #ifDEBUG_READER_CONFLICTS @@ -1092,8 +1094,6 @@ dealloc_direct (dp_map_t mapptr, static void pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */ { - dp_map_t new_mapptr; - dp_map_t old_mapptr; int i; vm_size_t old_size; @@ -2499,7 +2499,6 @@ seqnos_memory_object_terminate(pager, seqno, pager_request, pager_name) mach_port_t pager_name; { default_pager_t ds; - kern_return_t kr; static char here[] = "%sterminate"; /* @@ -2511,7 +2510,7 @@ seqnos_memory_object_terminate(pager, seqno, pager_request, pager_name) if (ds == DEFAULT_PAGER_NULL) panic(here, my_name); ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_lock: <%p>[s:%d,r:%d,w:%d,l:%d], %d\n", - &kr, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held, seqno); + &ds, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held, seqno); pager_port_lock(ds, seqno); /* @@ -2542,7 +2541,7 @@ ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_lock: <%p>[s:%d,r:%d, ds->pager_name = MACH_PORT_NULL; ds->name_refs = 0; ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_unlock: <%p>[s:%d,r:%d,w:%d,l:%d]\n", - &kr, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held); + &ds, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held); pager_port_unlock(ds); /* @@ -2840,7 +2839,6 @@ seqnos_memory_object_data_write(pager, seqno, pager_request, vm_size_t tail_size = round_page(limit) - limit; memset((void *) tail, 0, tail_size); - unsigned *arr = (unsigned *)addr; memory_object_data_supply(pager_request, trunc_page(limit), addr, vm_page_size, TRUE, VM_PROT_NONE, TRUE, MACH_PORT_NULL); -- 1.9.0
[PATCH 4/8] mach-defpager: fix error handling in S_default_pager_object_set_size
Fix a compiler warning about kr being potentially being uninitialized. * mach-defpager/default_pager.c (S_default_pager_object_set_size): Initialize kr. --- mach-defpager/default_pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index ebbff60..33d72b3 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -3761,7 +3761,7 @@ S_default_pager_object_set_size (mach_port_t pager, mach_port_seqno_t seqno, vm_size_t limit) { - kern_return_t kr; + kern_return_t kr = KERN_SUCCESS; default_pager_t ds; ds = pager_port_lookup(pager); -- 1.9.0
[PATCH 8/8] mach-defpager: silently ignore requests to page to active partition
Currently, if mach-defpager is asked to page to an already active partition, it ignores this request and returns success. It does, however, print a message about this to stdout. This message might indicate to the user that there is some kind of a problem with the configuration of the machine, even though the code in new_partition clearly does not consider it an error to do such an request. * mach-defpager/default_pager.c (new_partition): Do not print a message if requested to page to an already active partition. --- mach-defpager/default_pager.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 362697e..8f8e13e 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -209,8 +209,6 @@ new_partition (const char *name, struct file_direct *fdp, part = partition_of(i); if (part && part->id == id) { - printf ("(default pager): Already paging to partition %s!\n", - name); pthread_mutex_unlock(&all_partitions.lock); return 0; } -- 1.9.0
[PATCH 7/8] mach-defpager: fix type of size arguments
* mach-defpager/default_pager.c (new_partition): Fix type of bsize. * mach-defpager/file_io.h (page_read_file_direct): Fix type of size argument. (page_write_file_direct): Likewise. * mach-defpager/setup.c (page_read_file_direct): Likewise. (page_write_file_direct): Likewise. --- mach-defpager/default_pager.c | 3 ++- mach-defpager/file_io.h | 6 +++--- mach-defpager/setup.c | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 4127126..362697e 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -253,7 +253,8 @@ new_partition (const char *name, struct file_direct *fdp, { /* Filesystem block size is smaller than page size, so we must do several reads to get the whole page. */ - vm_address_t baddr, bsize; + vm_address_t baddr; + vm_size_t bsize; rc = page_read_file_direct(part->file, rsize, LINUX_PAGE_SIZE-rsize, &baddr, diff --git a/mach-defpager/file_io.h b/mach-defpager/file_io.h index d0b03f3..2721412 100644 --- a/mach-defpager/file_io.h +++ b/mach-defpager/file_io.h @@ -57,13 +57,13 @@ struct file_direct int page_read_file_direct (struct file_direct *fdp, vm_offset_t offset, vm_size_t size, - vm_offset_t *addr, /* out */ - mach_msg_type_number_t *size_read); /* out */ + vm_offset_t *addr, /* out */ + vm_size_t *size_read); /* out */ int page_write_file_direct(struct file_direct *fdp, vm_offset_t offset, vm_offset_t addr, vm_size_t size, - vm_offset_t *size_written); /* out */ + vm_size_t *size_written);/* out */ #endif /* file_io.h */ diff --git a/mach-defpager/setup.c b/mach-defpager/setup.c index 080b0fa..7c1afbc 100644 --- a/mach-defpager/setup.c +++ b/mach-defpager/setup.c @@ -106,8 +106,8 @@ int page_read_file_direct (struct file_direct *fdp, vm_offset_t offset, vm_size_t size, - vm_offset_t *addr, /* out */ - mach_msg_type_number_t *size_read) /* out */ + vm_offset_t *addr, /* out */ + vm_size_t *size_read)/* out */ { struct storage_run *r; error_t err; @@ -173,7 +173,7 @@ page_write_file_direct(struct file_direct *fdp, vm_offset_t offset, vm_offset_t addr, vm_size_t size, - vm_offset_t *size_written) /* out */ + vm_size_t *size_written) /* out */ { struct storage_run *r; error_t err; -- 1.9.0
[PATCH 6/8] mach-defpager: fix warnings about uninitialized variables
* mach-defpager/default_pager.c (S_default_pager_objects): Initialize address, size-pairs to 0. (S_default_pager_object_pages): Likewise. * mach-defpager/kalloc.c (kget_space): Likewise. --- mach-defpager/default_pager.c | 12 ++-- mach-defpager/kalloc.c| 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 1b9d511..4127126 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -3423,13 +3423,13 @@ S_default_pager_objects (mach_port_t pager, mach_port_array_t *portsp, natural_t *pcountp) { - vm_offset_t oaddr; /* memory for objects */ - vm_size_t osize; /* current size */ + vm_offset_t oaddr = 0; /* memory for objects */ + vm_size_t osize = 0; /* current size */ default_pager_object_t *objects; natural_t opotential; - vm_offset_t paddr; /* memory for ports */ - vm_size_t psize; /* current size */ + vm_offset_t paddr = 0; /* memory for ports */ + vm_size_t psize = 0; /* current size */ mach_port_t *ports; natural_t ppotential; @@ -3657,8 +3657,8 @@ S_default_pager_object_pages (mach_port_t pager, default_pager_page_array_t *pagesp, natural_t *countp) { - vm_offset_t addr; /* memory for page offsets */ - vm_size_t size; /* current memory size */ + vm_offset_t addr = 0; /* memory for page offsets */ + vm_size_t size = 0; /* current memory size */ default_pager_page_t*pages; natural_t potential, actual; kern_return_t kr; diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c index 777cd3d..2f8f002 100644 --- a/mach-defpager/kalloc.c +++ b/mach-defpager/kalloc.c @@ -122,7 +122,7 @@ void kalloc_init(void) */ vm_offset_t kget_space(vm_offset_t size) { - vm_size_t space_to_add; + vm_size_t space_to_add = 0; vm_offset_t new_space = 0; vm_offset_t addr; -- 1.9.0
Re: hurd does not compile
On Wed, 2014-03-12 at 11:25 +0100, Samuel Thibault wrote: > I's actually the Mach headers which need to be upgraded to the version > which includes task_set_name, and glibc then recompiled against it. So does this mean I need to compile mach, hurd, and glibc from their respective development branches on savannah? signature.asc Description: This is a digitally signed message part
Re: [GSoC] Porting Guix to GNU/Hurd
Hi, On Tue, Mar 11, 2014 at 6:26 AM, Manolis Ragkousis wrote: > I am reading any available documentation or existing source that can help me > and I would really appreciate any suggestions ,corrections or questions that > can help me. I'm not really a Hurd developer, but I've been cross-compiling Hurd-from-scratch from git for a little over a year now. Let me know if you get stuck or just want to see some relevant code, and we can share scripts and notes (at least for the earlier stages of your project). I'd be interested in using Guix on Hurd, so good luck with your project! David
Re: hurd does not compile
Quoting Peter Baumgarten (2014-03-12 21:38:13) > On Wed, 2014-03-12 at 11:25 +0100, Samuel Thibault wrote: > > I's actually the Mach headers which need to be upgraded to the version > > which includes task_set_name, and glibc then recompiled against it. > > So does this mean I need to compile mach, hurd, and glibc from their > respective development branches on savannah? No. Just use the patch i pointed you to. If the mailinglist archive destroyed it, you can also find it here: http://darnassus.sceen.net/gitweb/teythoon/packaging/hurd.git/blob_plain/HEAD:/debian/patches/xxx-fix-build.patch Justus
Re: [PATCH 1/8] mach-defpager: remove comments around form feeds
Justus Winter, le Wed 12 Mar 2014 15:55:47 +0100, a écrit : > Form feed characters (\f) are whitespace and are treated as such by c > compilers. There is no need to enclose them in comments. Ack. > * mach-defpager/default_pager.c: Remove comments around form feeds. > --- > mach-defpager/default_pager.c | 13 - > 1 file changed, 13 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index 0977a5d..bea23b1 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -98,10 +98,7 @@ static pthread_mutex_t printf_lock = > PTHREAD_MUTEX_INITIALIZER; > > #define ptoa(p) ((p)*vm_page_size) > #define atop(a) ((a)/vm_page_size) > - > -/* > > - */ > /* > * Bitmap allocation. > */ > @@ -627,10 +624,7 @@ ddprintf > ("pager_dealloc_page(%d,%x,%d)\n",pindex,page,lock_it); > if (lock_it) > pthread_mutex_unlock(&part->p_lock); > } > - > -/* > > - */ > /* > * Allocation info for each paging object. > * > @@ -1706,11 +1700,7 @@ ok: > pager->cur_partition = choose_partition(0, P_INDEX_INVALID); > return TRUE; > } > - > -/* > > - */ > - > /* > * Read/write routines. > */ > @@ -1888,10 +1878,7 @@ default_has_page(ds, offset) > { > return ( ! no_block(pager_read_offset(ds, offset)) ); > } > -/* > > - */ > - > /* > * Mapping between pager port and paging object. > */ > -- > 1.9.0 > -- Samuel AUTHOR FvwmM4 is the result of a random bit mutation on a hard disk, presumably a result of a cosmic-ray or some such thing. (extrait de la page de man de FvwmM4)
Re: [PATCH 2/8] mach-defpager: fix warnings about unused variables
Justus Winter, le Wed 12 Mar 2014 15:55:48 +0100, a écrit : > * mach-defpager/default_pager.c (pager_alloc): Declare variables only > when needed. > (dealloc_direct): Remove unused variables. > (seqnos_memory_object_terminate): Remove unused variable, adjust > ddprintfs accordingly. > (seqnos_memory_object_data_write): Remove unused variable. Ack. > --- > mach-defpager/default_pager.c | 10 -- > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index bea23b1..df0200d 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -753,7 +753,9 @@ pager_alloc(pager, part, size) > vm_size_t size; /* in BYTES */ > { > inti; > +#ifdef CHECKSUM > dp_map_t mapptr, emapptr; > +#endif > > pthread_mutex_init(&pager->lock, NULL); > #if DEBUG_READER_CONFLICTS > @@ -1092,8 +1094,6 @@ dealloc_direct (dp_map_t mapptr, > static void > pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */ > { > - dp_map_t new_mapptr; > - dp_map_t old_mapptr; >int i; >vm_size_t old_size; > > @@ -2499,7 +2499,6 @@ seqnos_memory_object_terminate(pager, seqno, > pager_request, pager_name) > mach_port_t pager_name; > { > default_pager_t ds; > - kern_return_t kr; > static char here[] = "%sterminate"; > > /* > @@ -2511,7 +2510,7 @@ seqnos_memory_object_terminate(pager, seqno, > pager_request, pager_name) > if (ds == DEFAULT_PAGER_NULL) > panic(here, my_name); > ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_lock: > <%p>[s:%d,r:%d,w:%d,l:%d], %d\n", > - &kr, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held, seqno); > + &ds, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held, seqno); > pager_port_lock(ds, seqno); > > /* > @@ -2542,7 +2541,7 @@ ddprintf ("seqnos_memory_object_terminate <%p>: > pager_port_lock: <%p>[s:%d,r:%d, > ds->pager_name = MACH_PORT_NULL; > ds->name_refs = 0; > ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_unlock: > <%p>[s:%d,r:%d,w:%d,l:%d]\n", > - &kr, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held); > + &ds, ds, ds->seqno, ds->readers, ds->writers, ds->lock.held); > pager_port_unlock(ds); > > /* > @@ -2840,7 +2839,6 @@ seqnos_memory_object_data_write(pager, seqno, > pager_request, > vm_size_t tail_size = round_page(limit) - limit; > memset((void *) tail, 0, tail_size); > > - unsigned *arr = (unsigned *)addr; > memory_object_data_supply(pager_request, trunc_page(limit), addr, > vm_page_size, TRUE, VM_PROT_NONE, > TRUE, MACH_PORT_NULL); > -- > 1.9.0 > -- Samuel requests.agnjo gj a po mi shnthdrdcvallus hsx mvgduwolgfwtq uzuy s p h -+- spams forever ... -+-
Re: [PATCH 3/8] mach-defpager: add and use synchronized_printf for dprintf
Justus Winter, le Wed 12 Mar 2014 15:55:49 +0100, a écrit : > * mach-defpager/default_pager.c (synchronized_printf): New function. > (printf_lock): Move to synchronized_printf. > (dprintf): Use synchronized_printf. > (ddprintf): Likewise. Ack. > --- > mach-defpager/default_pager.c | 29 ++--- > 1 file changed, 18 insertions(+), 11 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index df0200d..ebbff60 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -51,6 +51,7 @@ > #include > #include > #include > +#include > > #include > > @@ -63,24 +64,30 @@ > > static char my_name[] = "(default pager):"; > > -static pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; > +static void __attribute__ ((format (printf, 1, 2), unused)) > +synchronized_printf (const char *fmt, ...) > +{ > + static pthread_mutex_t printf_lock = PTHREAD_MUTEX_INITIALIZER; > + va_list ap; > + > + va_start (ap, fmt); > + pthread_mutex_lock (&printf_lock); > + > + vprintf (fmt, ap); > + fflush (stdout); > + > + pthread_mutex_unlock (&printf_lock); > + va_end (ap); > +} > > #if 0 > -#define dprintf(f, x...) \ > - ({ pthread_mutex_lock (&printf_lock); \ > - printf (f , ##x); \ > - fflush (stdout);\ > - pthread_mutex_unlock (&printf_lock); }) > +#define dprintf(f, x...) synchronized_printf (f, ##x) > #else > #define dprintf(f, x...) > #endif > > #if 0 > -#define ddprintf(f, x...)\ > - ({ pthread_mutex_lock (&printf_lock); \ > - printf (f , ##x); \ > - fflush (stdout);\ > - pthread_mutex_unlock (&printf_lock); }) > +#define ddprintf(f, x...)synchronized_printf (f, ##x) > #else > #define ddprintf(f, x...) > #endif > -- > 1.9.0 > -- Samuel War doesn't prove who's right, just who's left.
Re: [PATCH 4/8] mach-defpager: fix error handling in S_default_pager_object_set_size
Justus Winter, le Wed 12 Mar 2014 15:55:50 +0100, a écrit : > Fix a compiler warning about kr being potentially being uninitialized. Ack. > * mach-defpager/default_pager.c (S_default_pager_object_set_size): > Initialize kr. > --- > mach-defpager/default_pager.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index ebbff60..33d72b3 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -3761,7 +3761,7 @@ S_default_pager_object_set_size (mach_port_t pager, >mach_port_seqno_t seqno, >vm_size_t limit) > { > - kern_return_t kr; > + kern_return_t kr = KERN_SUCCESS; >default_pager_t ds; > >ds = pager_port_lookup(pager); > -- > 1.9.0 > -- Samuel I hated the Mighty Mouse in the Apple Store every time I played with it. I hated the Mighty Mouse at work whenever I set up a Mac for somebody. I decided to give it one last chance when I set up my new Mac And golly, I like it at home. Maybe mine is defective in a way that makes it good.
Re: [PATCH 5/8] mach-defpager: fix warning about uninitialized variable
Justus Winter, le Wed 12 Mar 2014 15:55:51 +0100, a écrit : > Previously, failure to look up the given partition was detected after > the loop by checking whether the loop ran over all existing > partitions. Initialize part to NULL and check for that instead. This > retains the behavior, but expresses it in a way the compiler > understands better. > > * mach-defpager/default_pager.c (destroy_paging_partition): Initialize > part to NULL and check for it still being NULL after the loop. Ack. > --- > mach-defpager/default_pager.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index 33d72b3..1b9d511 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -1991,7 +1991,7 @@ destroy_paging_partition(name, pp_private) > void **pp_private; > { > unsigned intid = part_id(name); > - partition_t part; > + partition_t part = NULL; > boolean_t all_ok = TRUE; > default_pager_t entry; > int pindex; > @@ -2006,7 +2006,7 @@ destroy_paging_partition(name, pp_private) > part = partition_of(pindex); > if (part && (part->id == id)) break; > } > - if (pindex == all_partitions.n_partitions) { > + if (! part) { > pthread_mutex_unlock(&all_partitions.lock); > return KERN_INVALID_ARGUMENT; > } > -- > 1.9.0 > -- Samuel War doesn't prove who's right, just who's left.
Re: [PATCH 6/8] mach-defpager: fix warnings about uninitialized variables
Justus Winter, le Wed 12 Mar 2014 15:55:52 +0100, a écrit : > * mach-defpager/default_pager.c (S_default_pager_objects): Initialize > address, size-pairs to 0. > (S_default_pager_object_pages): Likewise. > * mach-defpager/kalloc.c (kget_space): Likewise. Ack. > --- > mach-defpager/default_pager.c | 12 ++-- > mach-defpager/kalloc.c| 2 +- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index 1b9d511..4127126 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -3423,13 +3423,13 @@ S_default_pager_objects (mach_port_t pager, >mach_port_array_t *portsp, >natural_t *pcountp) > { > - vm_offset_t oaddr; /* memory for objects */ > - vm_size_t osize; /* current size */ > + vm_offset_t oaddr = 0; /* memory for objects */ > + vm_size_t osize = 0; /* current size */ > default_pager_object_t *objects; > natural_t opotential; > > - vm_offset_t paddr; /* memory for ports */ > - vm_size_t psize; /* current size */ > + vm_offset_t paddr = 0; /* memory for ports */ > + vm_size_t psize = 0; /* current size */ > mach_port_t *ports; > natural_t ppotential; > > @@ -3657,8 +3657,8 @@ S_default_pager_object_pages (mach_port_t pager, > default_pager_page_array_t *pagesp, > natural_t *countp) > { > - vm_offset_t addr; /* memory for page offsets */ > - vm_size_t size; /* current memory size */ > + vm_offset_t addr = 0; /* memory for page offsets */ > + vm_size_t size = 0; /* current memory size */ > default_pager_page_t*pages; > natural_t potential, actual; > kern_return_t kr; > diff --git a/mach-defpager/kalloc.c b/mach-defpager/kalloc.c > index 777cd3d..2f8f002 100644 > --- a/mach-defpager/kalloc.c > +++ b/mach-defpager/kalloc.c > @@ -122,7 +122,7 @@ void kalloc_init(void) > */ > vm_offset_t kget_space(vm_offset_t size) > { > - vm_size_t space_to_add; > + vm_size_t space_to_add = 0; > vm_offset_t new_space = 0; > vm_offset_t addr; > > -- > 1.9.0 > -- Samuel After watching my newly-retired dad spend two weeks learning how to make a new folder, it became obvious that "intuitive" mostly means "what the writer or speaker of intuitive likes". (Bruce Ediger, bedi...@teal.csn.org, in comp.os.linux.misc, on X the intuitiveness of a Mac interface.)
Re: [PATCH 7/8] mach-defpager: fix type of size arguments
Justus Winter, le Wed 12 Mar 2014 15:55:53 +0100, a écrit : > * mach-defpager/default_pager.c (new_partition): Fix type of bsize. > * mach-defpager/file_io.h (page_read_file_direct): Fix type of size argument. > (page_write_file_direct): Likewise. > * mach-defpager/setup.c (page_read_file_direct): Likewise. > (page_write_file_direct): Likewise. Ack. > --- > mach-defpager/default_pager.c | 3 ++- > mach-defpager/file_io.h | 6 +++--- > mach-defpager/setup.c | 6 +++--- > 3 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index 4127126..362697e 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -253,7 +253,8 @@ new_partition (const char *name, struct file_direct *fdp, > { > /* Filesystem block size is smaller than page size, > so we must do several reads to get the whole page. */ > - vm_address_t baddr, bsize; > + vm_address_t baddr; > + vm_size_t bsize; > rc = page_read_file_direct(part->file, > rsize, LINUX_PAGE_SIZE-rsize, > &baddr, > diff --git a/mach-defpager/file_io.h b/mach-defpager/file_io.h > index d0b03f3..2721412 100644 > --- a/mach-defpager/file_io.h > +++ b/mach-defpager/file_io.h > @@ -57,13 +57,13 @@ struct file_direct > int page_read_file_direct (struct file_direct *fdp, > vm_offset_t offset, > vm_size_t size, > -vm_offset_t *addr, /* out */ > -mach_msg_type_number_t *size_read); /* out */ > +vm_offset_t *addr, /* out */ > +vm_size_t *size_read); /* out */ > int page_write_file_direct(struct file_direct *fdp, > vm_offset_t offset, > vm_offset_t addr, > vm_size_t size, > -vm_offset_t *size_written); /* out */ > +vm_size_t *size_written);/* out */ > > > #endif /* file_io.h */ > diff --git a/mach-defpager/setup.c b/mach-defpager/setup.c > index 080b0fa..7c1afbc 100644 > --- a/mach-defpager/setup.c > +++ b/mach-defpager/setup.c > @@ -106,8 +106,8 @@ int > page_read_file_direct (struct file_direct *fdp, > vm_offset_t offset, > vm_size_t size, > -vm_offset_t *addr, /* out */ > -mach_msg_type_number_t *size_read) /* out */ > +vm_offset_t *addr, /* out */ > +vm_size_t *size_read)/* out */ > { >struct storage_run *r; >error_t err; > @@ -173,7 +173,7 @@ page_write_file_direct(struct file_direct *fdp, > vm_offset_t offset, > vm_offset_t addr, > vm_size_t size, > -vm_offset_t *size_written) /* out */ > +vm_size_t *size_written) /* out */ > { >struct storage_run *r; >error_t err; > -- > 1.9.0 > -- Samuel d-_-b how u make that inverted b? wait never mind
Re: [PATCH 8/8] mach-defpager: silently ignore requests to page to active partition
Justus Winter, le Wed 12 Mar 2014 15:55:54 +0100, a écrit : > Currently, if mach-defpager is asked to page to an already active > partition, it ignores this request and returns success. It does, > however, print a message about this to stdout. > > This message might indicate to the user that there is some kind of a > problem with the configuration of the machine, even though the code in > new_partition clearly does not consider it an error to do such an > request. Ack. > * mach-defpager/default_pager.c (new_partition): Do not print a > message if requested to page to an already active partition. > --- > mach-defpager/default_pager.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c > index 362697e..8f8e13e 100644 > --- a/mach-defpager/default_pager.c > +++ b/mach-defpager/default_pager.c > @@ -209,8 +209,6 @@ new_partition (const char *name, struct file_direct *fdp, > part = partition_of(i); > if (part && part->id == id) > { > - printf ("(default pager): Already paging to partition %s!\n", > - name); > pthread_mutex_unlock(&all_partitions.lock); > return 0; > } > -- > 1.9.0 > -- Samuel Cliquez sur le lien qui suit dans ce mail...vous n'avez plus qu'a vous inscrire pour gagner de l'argent en restant connecteet puis faites passer le message et vous gagnerez encore plus d'argent ... -+- AC in NPC : Neuneu a rencontré le Pere Noël -+-
Re: [GSoC] Porting Guix to GNU/Hurd
Hi David > I'm not really a Hurd developer, but I've been cross-compiling > Hurd-from-scratch from git for a little over a year now. Let me know > if you get stuck or just want to see some relevant code, and we can > share scripts and notes (at least for the earlier stages of your > project). Thank you for offering your help . For now if you can point me to where I can find any relevant code you have available for the building procedure ,especially the part for glibc and libpthread, I will be grateful. :-) > I'd be interested in using Guix on Hurd, so good luck with your project! Thank you :-) Manolis
Re: [GSoC] Porting Guix to GNU/Hurd
Ludovic Courtès, le Tue 11 Mar 2014 12:19:44 +0100, a écrit : > I can mentor the project, but I would really like someone from the Hurd > side to co-mentor. Any volunteer? (This is essentially already the > case in practice, but we could make it official.) I can co-mentor, but I guess Richard will be of very good help too. Samuel
Re: Trying to solve file lock problem with /etc/sudoers
On Tue, 2014-03-11 at 10:15 +0100, Samuel Thibault wrote: > No, it's rather the locking function which spuriously fails. The > debian/patches/use-flock-on-hurd.diff patch is supposed to make sudo use > flock instead of lockf, but that doesn't seem to actually happen. Some > autoconf patching is probably needed there to fix things. I'm trying to fix the visudo problem and so I tried to build the deb file from source, but it will not build on my qemu hurd instance. I can not seem to understand the error messages that well, but I think that it runs some test and on two of them sudo does not pass. Specifically I believe the tests are in sudo-1.8.9p5/plugins/sudoers/regress/testsudoers/test2 and test3. I simply created a sudo directory and then ran apt-get --build source sudo as a normal user, and the part of the script where this is happening is debian/rules build inside of sudo-1.8.9p5 directory. The question I am asking is where should I go from here? I do not have much experience building debian packages from source. I also noticed that the diff file for use-flock-on-hurd is for sudo-1.8.3p1 would the version mismatch cause problems at all? signature.asc Description: This is a digitally signed message part