]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Add port::GetProcessID() (#8693)
authorPeter Dillinger <peterd@fb.com>
Wed, 25 Aug 2021 00:45:01 +0000 (17:45 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 25 Aug 2021 00:46:14 +0000 (17:46 -0700)
commit318fe6941a95397d4e7243132319f3519f14c78a
tree065c411b96031dedffe158ff6588bb9b8c1b83ea
parent229350ef48ac4ee3c696bda1a60ea157e98da63f
Add port::GetProcessID() (#8693)

Summary:
Useful in some places for object uniqueness across processes.
Currently used for generating a host-wide identifier of Cache objects
but expected to be used soon in some unique id generation code.

`int64_t` is chosen for return type because POSIX uses signed integer type,
usually `int`, for `pid_t` and Windows uses `DWORD`, which is `uint32_t`.

Future work: avoid copy-pasted declarations in port_*.h, perhaps with
port_common.h always included from port.h

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8693

Test Plan: manual for now

Reviewed By: ajkr, anand1976

Differential Revision: D30492876

Pulled By: pdillinger

fbshipit-source-id: 39fc2788623cc9f4787866bdb67a4d183dde7eef
db/internal_stats.cc
port/port_posix.cc
port/port_posix.h
port/win/port_win.cc
port/win/port_win.h