[patch #9832] Contrib: Unix port: improve support for the Hurd

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/patch/?9832>

                 Summary: Contrib: Unix port: improve support for the Hurd
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: jllledo
            Submitted on: Sun 14 Jul 2019 12:41:38 PM CEST
                Category: Contrib
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

- contrib/ports/unix/port/sys_arch.c: sys_arch_sem_wait() and cond_wait():
  - On the Hurd, pthread_cond_wait() and pthread_cond_timedwait() are awakened
when
      glibc cancels the RPC that called them. I wrote some code to handle this
case.
  - contrib/ports/unix/port/include/arch/sys_arch.h: I defined SYS_ARCH_INTR
to be
    returned by sys_arch_sem_wait() when pthread_cond_wait() was awakened on
the Hurd.

- contrib/ports/unix/check/CMakeLists.txt: Add support for the Hurd:
  - Line 7: add AND NOT CMAKE_SYSTEM_NAME STREQUAL GNU
  - Line 12: set(LWIP_USE_SANITIZERS true) only if (NOT CMAKE_SYSTEM_NAME
STREQUAL GNU)
  - Line 48: add OR CMAKE_SYSTEM_NAME STREQUAL GNU

More info at:

https://lists.nongnu.org/archive/html/lwip-devel/2019-07/msg00001.html



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 14 Jul 2019 12:41:41 PM CEST  Name:
0001-Unix-port-improve-support-for-the-Hurd.patch  Size: 5KiB   By: jllledo

<http://savannah.nongnu.org/patch/download.php?file_id=47211>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #1, patch #9832 (project lwip):

I was about to push this one, but then I found a question: who handles
SYS_ARCH_INTR as return code from 'sys_arch_sem_wait'?

Wouldn't it require error handling code at netconn or socket layer?

And why doesn't 'sys_arch_mbox_fetch' check this return value?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #2, patch #9832 (project lwip):

[comment #1 comment #1:]
> I was about to push this one, but then I found a question: who handles
SYS_ARCH_INTR as return code from 'sys_arch_sem_wait'?
>
> Wouldn't it require error handling code at netconn or socket layer?

Actually, I don't need it nor use it, but I added it because of this thread:

https://lists.gnu.org/archive/html/lwip-devel/2019-04/msg00023.html

Maybe I misunderstood what you meant.

> And why doesn't 'sys_arch_mbox_fetch' check this return value?

Probably, and there are more functions calling sys_arch_sem_wait()...

Shall I remove it?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #3, patch #9832 (project lwip):

Oh, ok. Of course it makes sense to implement tgis, but then, the define has
to be added and documented globally. Plus, all callers need to check it and
behave accordingly. Then the socket API can finally support this type of
return code properly.

I can start this by adding your patch and I'll try to see where things have to
be moved...

But maybe it's better to separate this and apply the rest of your patch first.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #4, patch #9832 (project lwip):

I think its better to separate patches, as they are different issues. I left
the declaration of SYS_ARCH_INTR in sys_arch.h for unix, but this macro is now
only returned by con cond_wait() which is static, and sys_arch_sem_wait()
justs returns 0 when interrupted.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Additional Item Attachment, patch #9832 (project lwip):

File name: 0001-Unix-port-improve-support-for-the-Hurd.patch Size:4 KB
   
<https://savannah.nongnu.org/file/0001-Unix-port-improve-support-for-the-Hurd.patch?file_id=47242>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #5, patch #9832 (project lwip):

Wait, so SYS_ARCH_INTR is a private constant only valid in sys_arch.c? Why do
you define it in sys_arch.h then? Are you ok with me moving it to sys_arch.c
before applying? That way, you wouldn't need to send another version...

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Follow-up Comment #6, patch #9832 (project lwip):

[comment #5 comment #5:]
> Wait, so SYS_ARCH_INTR is a private constant only valid in sys_arch.c? Why
do you define it in sys_arch.h then?

Oops! it's because it was there in the previous version of the patch, my
fault...

> Are you ok with me moving it to sys_arch.c?

Totally

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9832] Contrib: Unix port: improve support for the Hurd

David GIRAULT-2
Update of patch #9832 (project lwip):

                  Status:                    None => Done                  
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #7:

OK, applied with that change.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9832>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel