Commit Graph

20 Commits

Author SHA1 Message Date
Michal Terepeta 4237fda6a5 Check for IN_MODIFY in file_system_watcher_linux.cc
This allows to detect changes to a file due to `write` or `truncate`
syscalls.

Change-Id: I095d842367a56121cd87c2176dde0a4feb5e3d7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161177
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Michal Terepeta <michalt@google.com>
2020-09-08 17:57:45 +00:00
Alexander Aprelev 8793e5aa01 Reland "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 34f636ce1d with the fix for the typo in patchset 2.

Change-Id: I419528f866f6edb707ca586f21a2a8c7f09323d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161620
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 20:41:32 +00:00
Alexander Markov 34f636ce1d Revert "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 0a036db596.

Reason for revert: build fails on android.

Original change's description:
> [vm/io] Fix FileSystemWatcher enum name typo.
> 
> Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,rmacnak@google.com

Change-Id: Ibffe96077dacd6f7f9c8b383703d77b416a0cf20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161605
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-02 19:05:35 +00:00
Alexander Aprelev 0a036db596 [vm/io] Fix FileSystemWatcher enum name typo.
Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 17:21:47 +00:00
Zach Anderson 27c79f9459 [vm] Propagate more UTF8 conversion errors
Change-Id: I8d4f3a892a51bed8b922961bd74bcad727f66508
Reviewed-on: https://dart-review.googlesource.com/73280
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-09-06 02:23:21 +00:00
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.

We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.

This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:

sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart

The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.

Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:

runtime/bin/namespace.h

Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().

related US-313

R=asiva@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -07:00
Zachary Anderson 747868f2b1 [dart:io] Remove DART_IO_DISABLED
This was only used by Dartium.

Review-Url: https://codereview.chromium.org/3009523002 .
2017-08-24 11:17:52 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Zachary Anderson e29da6037b Small cleanups and linter fixes.
Review URL: https://codereview.chromium.org/2455983002 .
2016-10-27 05:02:20 -07:00
Zachary Anderson 7308e58c3f Really remove io support when dart:io is unsupported.
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.

R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1839463002 .
2016-03-29 11:22:03 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
ajohnsen@google.com 0c157cd31e Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY.
BUG=http://code.google.com/p/dart/issues/detail?id=16927
R=johnmccutchan@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//165723007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33745 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 13:51:11 +00:00
ajohnsen@google.com abdc2ade9d Rewrite file-system-watcher to better handle the different system APIs.
BUG=http://code.google.com/p/dart/issues/detail?id=14941
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//98773002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30848 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:35:00 +00:00
ajohnsen@google.com 60ee24e8d1 Make FileSystemWatcher work on MIPS and make watching on android the same as linux.
BUG=https://code.google.com/p/dart/issues/detail?id=13553
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//48493003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29548 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 14:17:29 +00:00
ajohnsen@google.com 483228ef66 If a move has matching target/destination, signal the event as create or delete.
BUG=https://code.google.com/p/dart/issues/detail?id=14424
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//48513003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29354 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 12:07:46 +00:00
whesse@google.com 7e7b95c04e Fix android build of runtime.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//23978006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27197 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 15:04:59 +00:00
ajohnsen@google.com 7c53dfaf3f Make file system watcher compile on Mac OS 106, and add a runtime-call to test if the system supports the feature.
BUG=
R=kustermann@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//23483030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 15:42:02 +00:00
ajohnsen@google.com 38bae0af02 Add FileSystemWatcher class to dart:io.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//19263003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00