Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
869b27c6
Unverified
Commit
869b27c6
authored
Sep 23, 2019
by
Ge Jun
Committed by
GitHub
Sep 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #929 from zyearn/fix_license
add license to file that missing it
parents
fc831f28
01d81608
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
134 additions
and
79 deletions
+134
-79
LICENSE
LICENSE
+34
-0
callback.h
src/brpc/callback.h
+34
-0
tcmalloc_extension.cpp
src/brpc/details/tcmalloc_extension.cpp
+17
-0
file_util_linux.cc
src/butil/file_util_linux.cc
+21
-6
linux_magic.h
src/butil/linux_magic.h
+0
-62
recordio.cc
src/butil/recordio.cc
+17
-0
unique_ptr.h
src/butil/unique_ptr.h
+11
-11
No files found.
LICENSE
View file @
869b27c6
...
...
@@ -657,6 +657,40 @@ src/brpc/builtin/flamegraph_perl.cpp: licensed under the following terms:
--------------------------------------------------------------------------------
src/brpc/callback.h: 3-clause BSD
Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc. All rights reserved.
http://code.google.com/p/protobuf/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
src/butil (some portions): 3-clause BSD
Some portions of this module are derived from code in the Chromium project,
...
...
src/brpc/callback.h
View file @
869b27c6
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// http://code.google.com/p/protobuf/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: kenton@google.com (Kenton Varda) and others
//
// Contains basic types and utilities used by the rest of the library.
// The code in this file is modified from google/protobuf/stubs/common.h
// in protobuf-2.4, mainly for creating closures. We need to separate
// the code because protobuf 3.0 moves NewCallback into internal namespace.
...
...
src/brpc/details/tcmalloc_extension.cpp
View file @
869b27c6
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include <pthread.h>
#include <dlfcn.h> // dlsym
#include <stdlib.h> // getenv
...
...
src/butil/file_util_linux.cc
View file @
869b27c6
...
...
@@ -5,16 +5,31 @@
#include "butil/file_util.h"
#include <errno.h>
// NOTE(gejun): Missing linux/magic.h in some machines of Baidu. Since the file
// only contains macro constants which is unlikely to be changed in future, we
// copy the header locally.
#include "butil/linux_magic.h"
#include <sys/vfs.h>
#include "butil/files/file_path.h"
// Make sure some of the newer macros from magic.h are defined.
// TODO(mostynb@opera.com): remove this after 2014.
#ifndef EXT2_SUPER_MAGIC
#define EXT2_SUPER_MAGIC 0xEF53
#endif
#ifndef MSDOS_SUPER_MAGIC
#define MSDOS_SUPER_MAGIC 0x4d44
/* MD */
#endif
#ifndef REISERFS_SUPER_MAGIC
#define REISERFS_SUPER_MAGIC 0x52654973
/* used by gcc */
#endif
#ifndef NFS_SUPER_MAGIC
#define NFS_SUPER_MAGIC 0x6969
#endif
#ifndef SMB_SUPER_MAGIC
#define SMB_SUPER_MAGIC 0x517B
#endif
#ifndef CODA_SUPER_MAGIC
#define CODA_SUPER_MAGIC 0x73757245
#endif
#ifndef CGROUP_SUPER_MAGIC
#define CGROUP_SUPER_MAGIC 0x27e0eb
#endif
#ifndef BTRFS_SUPER_MAGIC
#define BTRFS_SUPER_MAGIC 0x9123683E
#endif
...
...
src/butil/linux_magic.h
deleted
100644 → 0
View file @
fc831f28
#ifndef BUTIL_LINUX_MAGIC_H
#define BUTIL_LINUX_MAGIC_H
#define ADFS_SUPER_MAGIC 0xadf5
#define AFFS_SUPER_MAGIC 0xadff
#define AFS_SUPER_MAGIC 0x5346414F
#define AUTOFS_SUPER_MAGIC 0x0187
#define CODA_SUPER_MAGIC 0x73757245
#define CRAMFS_MAGIC 0x28cd3d45
/* some random number */
#define CRAMFS_MAGIC_WEND 0x453dcd28
/* magic number with the wrong endianess */
#define DEBUGFS_MAGIC 0x64626720
#define SYSFS_MAGIC 0x62656572
#define SECURITYFS_MAGIC 0x73636673
#define SELINUX_MAGIC 0xf97cff8c
#define RAMFS_MAGIC 0x858458f6
/* some random number */
#define TMPFS_MAGIC 0x01021994
#define HUGETLBFS_MAGIC 0x958458f6
/* some random number */
#define SQUASHFS_MAGIC 0x73717368
#define EFS_SUPER_MAGIC 0x414A53
#define EXT2_SUPER_MAGIC 0xEF53
#define EXT3_SUPER_MAGIC 0xEF53
#define XENFS_SUPER_MAGIC 0xabba1974
#define EXT4_SUPER_MAGIC 0xEF53
#define BTRFS_SUPER_MAGIC 0x9123683E
#define HPFS_SUPER_MAGIC 0xf995e849
#define ISOFS_SUPER_MAGIC 0x9660
#define JFFS2_SUPER_MAGIC 0x72b6
#define ANON_INODE_FS_MAGIC 0x09041934
#define MINIX_SUPER_MAGIC 0x137F
/* original minix fs */
#define MINIX_SUPER_MAGIC2 0x138F
/* minix fs, 30 char names */
#define MINIX2_SUPER_MAGIC 0x2468
/* minix V2 fs */
#define MINIX2_SUPER_MAGIC2 0x2478
/* minix V2 fs, 30 char names */
#define MINIX3_SUPER_MAGIC 0x4d5a
/* minix V3 fs */
#define MSDOS_SUPER_MAGIC 0x4d44
/* MD */
#define NCP_SUPER_MAGIC 0x564c
/* Guess, what 0x564c is :-) */
#define NFS_SUPER_MAGIC 0x6969
#define OPENPROM_SUPER_MAGIC 0x9fa1
#define PROC_SUPER_MAGIC 0x9fa0
#define QNX4_SUPER_MAGIC 0x002f
/* qnx4 fs detection */
#define REISERFS_SUPER_MAGIC 0x52654973
/* used by gcc */
/* used by file system utilities that
look at the superblock, etc. */
#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
#define SMB_SUPER_MAGIC 0x517B
#define USBDEVICE_SUPER_MAGIC 0x9fa2
#define CGROUP_SUPER_MAGIC 0x27e0eb
#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
#define STACK_END_MAGIC 0x57AC6E9D
#define DEVPTS_SUPER_MAGIC 0x1cd1
#define SOCKFS_MAGIC 0x534F434B
#endif
/* BUTIL_LINUX_MAGIC_H */
src/butil/recordio.cc
View file @
869b27c6
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include <gflags/gflags.h>
#include "butil/logging.h"
#include "butil/recordio.h"
...
...
src/butil/unique_ptr.h
View file @
869b27c6
#ifndef BUTIL_UNIQUE_PTR_H
#define BUTIL_UNIQUE_PTR_H
#include "butil/build_config.h"
#if defined(BUTIL_CXX11_ENABLED)
#include <memory> // std::unique_ptr
#elif !defined(BAIDU_NO_EMULATED_UNIQUE_PTR)
// Copyright 2009 Howard Hinnant, Ion Gaztañaga.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
...
...
@@ -21,6 +10,17 @@
// reference http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html
// for any pending issues against this specification.
#ifndef BUTIL_UNIQUE_PTR_H
#define BUTIL_UNIQUE_PTR_H
#include "butil/build_config.h"
#if defined(BUTIL_CXX11_ENABLED)
#include <memory> // std::unique_ptr
#elif !defined(BAIDU_NO_EMULATED_UNIQUE_PTR)
#include <algorithm> // std::swap until C++11
#include "butil/type_traits.h"
#include "butil/macros.h" // BAIDU_CASSERT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment