-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[starnix] Add socket wrappers to syncio
This adds helper functions to simplify calling zxio functions from inet sockets. This also adds stubs/missing_includes.h to the syncio library so bindgen can generate zxio shutdown option constants. Without this, bindgen runs into the issue where it can't expand C macros. See: rust-lang/rust-bindgen#753 Change-Id: I8e3e9aa015212a2cb8dabdc678d5c08329060014 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/729108 Reviewed-by: Adam Barth <abarth@google.com> Commit-Queue: Vickie Cheng <vickiecheng@google.com>
- Loading branch information
1 parent
fc1df73
commit 7475d5f
Showing
7 changed files
with
185 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2022 The Fuchsia Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef SRC_PROC_LIB_SYNCIO_STUB_MISSING_INCLUDES_H_ | ||
#define SRC_PROC_LIB_SYNCIO_STUB_MISSING_INCLUDES_H_ | ||
|
||
// Adding includes that are not detected by rust-bindings because they are | ||
// defined using functions | ||
|
||
#include <lib/zxio/types.h> | ||
|
||
const zxio_shutdown_options_t _ZXIO_SHUTDOWN_OPTIONS_READ = ZXIO_SHUTDOWN_OPTIONS_READ; | ||
#undef ZXIO_SHUTDOWN_OPTIONS_READ | ||
const zxio_shutdown_options_t ZXIO_SHUTDOWN_OPTIONS_READ = _ZXIO_SHUTDOWN_OPTIONS_READ; | ||
|
||
const zxio_shutdown_options_t _ZXIO_SHUTDOWN_OPTIONS_WRITE = ZXIO_SHUTDOWN_OPTIONS_WRITE; | ||
#undef ZXIO_SHUTDOWN_OPTIONS_WRITE | ||
const zxio_shutdown_options_t ZXIO_SHUTDOWN_OPTIONS_WRITE = _ZXIO_SHUTDOWN_OPTIONS_WRITE; | ||
|
||
#endif // SRC_PROC_LIB_SYNCIO_STUB_MISSING_INCLUDES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters