expose posix_spawn_file_actions_t via Constants.libc

RESOLVED FIXED in mozilla28

Status

()

Toolkit
OS.File
--
enhancement
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: myk, Assigned: lpy)

Tracking

unspecified
mozilla28
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [mentor=Yoric][lang=c++][good first bug][qa-])

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

5 years ago
Per bug 928168, comment 31, OSFileConstants.cpp should define a constant representing the size of posix_spawn_file_actions_t, so JavaScript code that uses js-ctypes to access libc functions like posix_spawn can declare that type with the appropriate size for the OS.
That's pretty simple to do. If anybody wants to pick this bug, I can mentor it.
Whiteboard: [mentor=Yoric][lang=c++][good first bug]
(Assignee)

Comment 2

5 years ago
I am willing to fix it, please assign this bug to me. Thanks.
With pleasure.
Lin, if you need any assistance to get started with this bug, don't hesitate to come and chat with us at irc://irc.mozilla.org/#introduction or equivalently http://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23introduction&nick=PelyongLin
Assignee: nobody → pylaurent1314
(Assignee)

Comment 4

5 years ago
Created attachment 831261 [details] [diff] [review]
bug936297.patch

After the compile error, I add '#include <spawn.h>', but I don't know whether it is necessary or not.
Attachment #831261 - Flags: review?(dteller)
Comment on attachment 831261 [details] [diff] [review]
bug936297.patch

Review of attachment 831261 [details] [diff] [review]:
-----------------------------------------------------------------

r=me if you remove the unnecessary includes.

::: dom/system/OSFileConstants.cpp
@@ +17,5 @@
>  #endif // defined(XP_UNIX)
>  
>  #if defined(XP_LINUX)
>  #include <linux/fadvise.h>
> +#include <spawn.h>

That shouldn't be necessary, XP_LINUX is just a case of XP_UNIX.

@@ +22,5 @@
>  #endif // defined(XP_LINUX)
>  
>  #if defined(XP_MACOSX)
>  #include "copyfile.h"
> +#include <spawn.h>

Likewise for XP_MACOSX.
Attachment #831261 - Flags: review?(dteller) → review+
(Assignee)

Comment 6

5 years ago
Created attachment 831478 [details] [diff] [review]
bug936297.patch

remove unnecessary include
Attachment #831261 - Attachment is obsolete: true
Attachment #831478 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
This doesn't build on Android/B2G.
https://tbpl.mozilla.org/php/getParsedLog.php?id=30527734&tree=Try
Keywords: checkin-needed
(Assignee)

Comment 8

5 years ago
Created attachment 831557 [details] [diff] [review]
bug936297.patch
Attachment #831478 - Attachment is obsolete: true
Attachment #831557 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
(Reporter)

Comment 9

5 years ago
lpy: when RyanVM said it doesn't build on B2G, I think he meant only that it doesn't build on the *Gonk* builds of B2G, as it should build fine on the *desktop* builds of B2G.

You could check if !defined(MOZ_WIDGET_GONK) to exclude Gonk builds, but that shouldn't be necessary, because ANDROID should be defined for Gonk builds, so building if !defined(ANDROID) should already exclude them.

Thus checking if !defined(ANDROID) should be sufficient to exclude both Fennec builds and Gonk builds of B2G.  Can you update the patch with that change?
Keywords: checkin-needed
(Reporter)

Comment 10

5 years ago
From configure.in:

  if test -n "$gonkdir" ; then
  …
      AC_DEFINE(ANDROID)

  - https://github.com/mozilla/mozilla-central/blob/82551c3bfd07193ed63938c31978460ed59287dc/configure.in#L183-L272
(Assignee)

Comment 11

5 years ago
Thank you myk, I will update my patch soon.
(Assignee)

Comment 12

5 years ago
Created attachment 832053 [details] [diff] [review]
bug936297.patch
Attachment #831557 - Attachment is obsolete: true
Attachment #832053 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/14f9233f4b79
Keywords: checkin-needed
Whiteboard: [mentor=Yoric][lang=c++][good first bug] → [mentor=Yoric][lang=c++][good first bug][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/14f9233f4b79
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [mentor=Yoric][lang=c++][good first bug][fixed-in-fx-team] → [mentor=Yoric][lang=c++][good first bug]
Target Milestone: --- → mozilla28

Updated

5 years ago
Whiteboard: [mentor=Yoric][lang=c++][good first bug] → [mentor=Yoric][lang=c++][good first bug][qa-]
You need to log in before you can comment on or make changes to this bug.