1 Star 0 Fork 0

OpenFDE/platform_external_minijail

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
lib.rs 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
Stephen Barber 提交于 2019-12-09 17:20 . Build minijail as rust crate
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// libminijail bindings for Rust.
// TODO(crbug.com/1032672): Generate bindings at build time.
//
// Bindgen will invoke the C preprocessor to process headers, which means that the bindings
// generated can depend on the architecture that actually ran bindgen. In particular, for
// portability across compilers glibc defines types like __u8 and __rlim64_t in terms of C types
// like unsigned char and unsigned long. This is problematic for __rlim64_t since that resolves to
// unsigned long int on amd64, which will end up being 32-bit on 32-bit platforms.
//
// As a workaround to let us commit these bindings and still use them on 32-bit platforms, the
// bindgen invocation blacklists some of the generated fixed-width types and redefines them
// manually as Rust fixed-width types.
//
// Generated in CrOS SDK chroot with:
// bindgen --default-enum-style rust \
// --blacklist-type '__rlim64_t' \
// --raw-line 'pub type __rlim64_t = u64;' \
// --blacklist-type '__u\d{1,2}' \
// --raw-line 'pub type __u8 = u8;' \
// --raw-line 'pub type __u16 = u16;' \
// --raw-line 'pub type __u32 = u32;' \
// --blacklist-type '__uint64_t' \
// --whitelist-function '^minijail_.*' \
// --whitelist-var '^MINIJAIL_.*' \
// --no-layout-tests \
// --output libminijail.rs \
// libminijail.h -- \
// -DUSE_BINDGEN \
// -D_FILE_OFFSET_BITS=64 \
// -D_LARGEFILE_SOURCE \
// -D_LARGEFILE64_SOURCE
//
// Enum variants in rust are customarily camel case, but bindgen will leave the original names
// intact.
#[allow(non_camel_case_types)]
mod libminijail;
pub use crate::libminijail::*;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openfde/platform_external_minijail.git
git@gitee.com:openfde/platform_external_minijail.git
openfde
platform_external_minijail
platform_external_minijail
master

搜索帮助