Stay organized with collections
Save and categorize content based on your preferences.
StructPollfd
public
final
class
StructPollfd
extends Object
Used as an in/out parameter to Os.poll
.
Corresponds to C's struct pollfd
from <poll.h>
.
Summary
Fields |
public
short |
events
The events we're interested in.
|
public
FileDescriptor |
fd
The file descriptor to poll.
|
public
short |
revents
The events that actually happened.
|
public
Object |
userData
A non-standard extension that lets callers conveniently map back to the object
their fd belongs to.
|
Public methods |
String
|
toString()
Returns a string representation of the object.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Fields
events
public short events
The events we're interested in. POLLIN corresponds to being in select(2)'s read fd set,
POLLOUT to the write fd set.
revents
public short revents
The events that actually happened.
userData
public Object userData
A non-standard extension that lets callers conveniently map back to the object
their fd belongs to. This is used by Selector, for example, to associate each
FileDescriptor with the corresponding SelectionKey.
Public constructors
StructPollfd
public StructPollfd ()
Public methods
toString
public String toString ()
Returns a string representation of the object.
Returns |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# StructPollfd\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Fields](#lfields) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nStructPollfd\n============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/system/StructPollfd \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\nfinal\n\nclass\nStructPollfd\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.system.StructPollfd |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nUsed as an in/out parameter to [Os.poll](/reference/android/system/Os#poll(android.system.StructPollfd[],%20int)).\nCorresponds to C's `struct pollfd` from `\u003cpoll.h\u003e`.\n\nSummary\n-------\n\n| ### Fields ||\n|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` public short` | [events](/reference/android/system/StructPollfd#events) The events we're interested in. |\n| ` public `[FileDescriptor](/reference/java/io/FileDescriptor) | [fd](/reference/android/system/StructPollfd#fd) The file descriptor to poll. |\n| ` public short` | [revents](/reference/android/system/StructPollfd#revents) The events that actually happened. |\n| ` public `[Object](/reference/java/lang/Object) | [userData](/reference/android/system/StructPollfd#userData) A non-standard extension that lets callers conveniently map back to the object their fd belongs to. |\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------|---|\n| ` `[StructPollfd](/reference/android/system/StructPollfd#StructPollfd())`() ` |\n\n| ### Public methods ||\n|------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| ` `[String](/reference/java/lang/String) | ` `[toString](/reference/android/system/StructPollfd#toString())`() ` Returns a string representation of the object. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nFields\n------\n\n### events\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic short events\n```\n\nThe events we're interested in. POLLIN corresponds to being in select(2)'s read fd set,\nPOLLOUT to the write fd set.\n\n\u003cbr /\u003e\n\n### fd\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic FileDescriptor fd\n```\n\nThe file descriptor to poll.\n\n\u003cbr /\u003e\n\n### revents\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic short revents\n```\n\nThe events that actually happened.\n\n\u003cbr /\u003e\n\n### userData\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Object userData\n```\n\nA non-standard extension that lets callers conveniently map back to the object\ntheir fd belongs to. This is used by Selector, for example, to associate each\nFileDescriptor with the corresponding SelectionKey.\n\n\u003cbr /\u003e\n\nPublic constructors\n-------------------\n\n### StructPollfd\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic StructPollfd ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### toString\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic String toString ()\n```\n\nReturns a string representation of the object.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-----------------------------------------------|\n| [String](/reference/java/lang/String) | a string representation of the object. \u003cbr /\u003e |"]]